473,800 Members | 2,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem of ToOADate function

Hi All,

ToOADate can change a date value to a double value, but if I change
the Regional and Lauguage setting in control panel, for example,
change English(US) to English(Austral ia) , the same date time will get
different double values from function ToOADate. How to always get the
same double value no matter what setting is in control panel?

Thanks for the help!

Mar 15 '07 #1
5 2937
Hi Snow,

If you change English(US) to English(Austral ia), do you than change all your
individual dates as well?

11-1-2007 means in General English notation 11 January 2007 in USA English
it means November 1th 2007.

Cor

Cor

"snow" <ba**********@y ahoo.comschreef in bericht
news:11******** **************@ e1g2000hsg.goog legroups.com...
Hi All,

ToOADate can change a date value to a double value, but if I change
the Regional and Lauguage setting in control panel, for example,
change English(US) to English(Austral ia) , the same date time will get
different double values from function ToOADate. How to always get the
same double value no matter what setting is in control panel?

Thanks for the help!

Mar 15 '07 #2
On Mar 14, 10:40 pm, "Cor Ligthert [MVP]" <notmyfirstn... @planet.nl>
wrote:
Hi Snow,

If you change English(US) to English(Austral ia), do you than change all your
individual dates as well?

11-1-2007 means in General English notation 11 January 2007 in USA English
it means November 1th 2007.

Cor

Cor

"snow" <barbara_d...@y ahoo.comschreef in berichtnews:11* *************** ******@e1g2000h sg.googlegroups .com...
Hi All,
ToOADatecan change a date value to a double value, but if I change
the Regional and Lauguage setting in control panel, for example,
change English(US) to English(Austral ia) , the same date time will get
different double values fromfunctionToO ADate. How to always get the
same double value no matter what setting is in control panel?
Thanks for the help!- Hide quoted text -

- Show quoted text -
Hi Cor,

That is the reason caused the problem. I developed an application
program which plot the date and temperature in the spreadsheet. The
date on my computer, for example 3/4/2007, means March 4th, 2007 ,
English(US) setting. When the program runs on a customer's computer,
the same date changes to April, 3rd, 2007, English(Austral ia) setting.
The program reads the date from spreadsheet and changes date to double
value for plotting, the result is totally different. The date format
is defined by the computer system setting. The functin ToOADate should
know the system setting, but it seems alway taking mm/dd/yy format and
changes to double. So how to get the same double value from the date
on different time setting systems?

Mar 15 '07 #3
snow wrote:
<snip>
I developed an application
program which plot the date and temperature in the spreadsheet. The
date on my computer, for example 3/4/2007, means March 4th, 2007 ,
English(US) setting. When the program runs on a customer's computer,
the same date changes to April, 3rd, 2007, English(Austral ia) setting.
The program reads the date from spreadsheet and changes date to double
value for plotting, the result is totally different. The date format
is defined by the computer system setting. The functin ToOADate should
know the system setting, but it seems alway taking mm/dd/yy format and
changes to double. So how to get the same double value from the date
on different time setting systems?
It seems to me that the problem has nothing to do with ToOADate method
-- which just operates on the binaries of the current date value --
but in the date assignment itself.

Maybe you could provide the code that reads the data from the
spreadsheet, for that's where the problem lies in, I guess.

HTH.

Regards,

Branco.


Mar 15 '07 #4
On Mar 15, 10:45 am, "Branco Medeiros" <branco.medei.. .@gmail.com>
wrote:
snow wrote:

<snip>
I developed an application
program which plot the date and temperature in the spreadsheet. The
date on my computer, for example 3/4/2007, means March 4th, 2007 ,
English(US) setting. When the program runs on a customer's computer,
the same date changes to April, 3rd, 2007, English(Austral ia) setting.
The program reads the date from spreadsheet and changes date to double
value for plotting, the result is totally different. The date format
is defined by the computer system setting. ThefunctinToOAD ateshould
know the system setting, but it seems alway taking mm/dd/yy format and
changes to double. So how to get the same double value from the date
on different time setting systems?

It seems to me that the problem has nothing to do withToOADatemet hod
-- which just operates on the binaries of the current date value --
but in the date assignment itself.

Maybe you could provide the code that reads the data from the
spreadsheet, for that's where the problem lies in, I guess.

HTH.

Regards,

Branco.
What my problem is the date setting. If the computer setting is
English(US), I have a date variable, for example myDate = #3/5/2007
12:00:00#, when I use myDate.ToOADate , I got a double value myDouble;
If the computer setting is English(Austral ia), myDate = #5/3/2007
12:00:00", which is the same date in different format, when I use
myDate.ToOADate , I got another double value myNew Double. myDouble
should be same as myNewDouble. so How to get same double value in
different time setting computer? is it a bug for function ToOADate?

Thanks!

Mar 19 '07 #5
snow wrote:
<snip>
What my problem is the date setting.
I don't thik so. Maybe I'm wrong, but your problem seems to be the way
you parse the date provided by the Excel spreadsheet.
If the computer setting is
English(US), I have a date variable, for example myDate = #3/5/2007
12:00:00#, when I use myDate.ToOADate , I got a double value myDouble;
If the computer setting is English(Austral ia), myDate = #5/3/2007
12:00:00", which is the same date in different format,
<snip>

Nope. The date literal uses the format #month/day/year#, regardless of
the cmputer's international settings.

Therefore, #5/3/2007#, regardless of the international settings, will
always represent the 3rd of may, 2007. And #3/5/2007# will always
represent the 5th of march, 2007. Two different dates, two different
doubles. Try it in both computers and you'll see.

Regards,

Branco.

Mar 19 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2441
by: Emanuel Ziegler | last post by:
Hello, I want to do some mathematics with functions. In my case the function classes are very complex, but this simple example has the same problems. To allow calculations that begin with a double, I have to define a global operator+ (or -*/) and special function classes. --- source begins here ---
117
7273
by: Peter Olcott | last post by:
www.halting-problem.com
1
3649
by: Mohamed Fysal | last post by:
I have written a Regular DLL with many Export Functions and one CALLBACK fun ction . The callback function declared in the .cpp file of the Regular DLL is as fol lows: typedef BOOL (CALLBACK* ExProcessMessage)(UINT msg, LPVOID lpParam); // ExProcessMessage MyProcMsg;
11
10422
by: tohear | last post by:
ToOADate and FromOADate don't handle negative dates with time parts correctly. Negative dates with no time parts are OK. (Note: In COM date "zero" is 12/30/1899). Does anyone know if these are known bugs and if they will be corrected? In the meantime I strongly recommend writing your own functions if you work with negative time. In particular if you've converted a vb6 project to dotnet. -----------------------
1
15314
by: Kenny | last post by:
I am having issues with the "Date.ToOADate" method in VB .NET. I understand that in VB6 the function DateSerial gives an internal representation of the date. When I use the DateSerial method in VB .Net, dragging the mouse over to the statement, VB .NET reports the following "Conversion from 'Date' to "Double' requires calling the 'Date.ToOAdate' method. When I tyoe this method in, the syntax checker undelines
12
5135
by: Joel Byrd | last post by:
I'm having a little problem with using type-ahead functionality for an auto-suggest box. Sometimes, when I start to type something and the type-ahead shows up, the AJAX will send a request query using the value that *includes* the type-ahead value. In other words, say that I type in "ja" and the first listing that comes up is "jack@test.com". The AJAX part is supposed to send "ja" as one of the query string variables when calling the...
2
2533
by: Fernando Barsoba | last post by:
Dear all, I have been posting about a problem trying to encrypt certain data using HMAC-SHA1 functions. I posted that my problem was solved, but unfortunately, I was being overly optimistic. I am really desperate now, because I havent' been able to locate the origin of the problem for a couple of days now.. PROBLEM: the message digest obtained differs each time I execute the code, but works perfectly when applying the "control", that...
2
3704
by: Ken Varn | last post by:
I have a managed C++ method that I call from ASP.NET to set the time zone on the local box. I call SetTimeZoneInformation, which does not return an error, but the time zone remains unchanged. I have checked the web for any information on this, but have not found any articles that relate to this specific problem. Can anyone tell me what is wrong here? Here is a sample snippet of the method: Note that TimeZoneInfo is my own managed...
1
9572
by: =?Utf-8?B?RGFwcGVyRGFuSEBub3NwYW0ubm9zcGFt?= | last post by:
Given the example below, can someone explain why TimeSpan.TotalDays gives a different result than subtracting 2 DateTime.ToOADates? I am completely stumped. Thanks in advance, Dan Example Output: start: 1/1/2007 12:00:00 AM end : 1/1/2007 1:00:00 AM
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10279
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10255
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6815
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5473
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4150
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2948
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.