I probably don't understand something obvious or am not setting something right...but anyway....
I am using wxDevC++ on Windows XP. I am using the microsoft C++ compiler.
My problem is that my program seems to assume that I am in the Central timezone (US). If the timezone in the computer is set to Pacific time (my timezone), the WxDateTime::Today() function returns the next day between the hours of 10:00 PM and Midnight. If the computer's timezone is set to Central time, the program works as it is supposed to.
The following code fragment displays tomorrow's date on the screen if run between 10:00 and Midnight local time if the computer's timezone is set to Pacific time, otherwise it will display today's date. If the timezone is Central time, it always displays today's date.
wxDateTime testtime;
testtime=wxDateTime::Today();
wxMessageBox(testtime.FormatISODate());
I would like it to always display the local date.
Timezone problem - reposted from general development
I tried Now()...results were the same as with Today(). It seems that for some reason wxWidgets thinks my timezone is set to Central time. (I used to live in Iowa, so this computer was once in the Central timezone.....but is now set to the Pacific timezone.)
How would you query the OS, in wxWidgets, to get the local timezone?
How would you query the OS, in wxWidgets, to get the local timezone?
Tried running the program on another computer - one which has been in the Pacific timezone since I first installed windows on it - and the same executable file gave the correct date.
Is there some sort of Windows bug where the timezone Windows is installed with the first time is permanently etched in its memory somewhere?
Is there some sort of Windows bug where the timezone Windows is installed with the first time is permanently etched in its memory somewhere?
I had a similar problem to this though it wasn't because of wxWidgets. It would happen when booting between operating systems on my laptop. Both OS had the same timezone settings but one would always have an accelerated time, for lack of a better phraze, then the other. Ended up having something to do with one OS set to use UTC time and the other being set to use local time settings.
Note sure if that would help but it maybe one possibilty worth looking at.
Note sure if that would help but it maybe one possibilty worth looking at.
____
wxWidgest 2.8.2 / 2.8.6u
mingw32-gcc-3.4.2 / gcc 4.1.2
wxDev-CPP beta 6.10.2 / Anjuta
Dev-CPP (4.9.9.2)
XP Pro / Vista / Feodra 8
wxWidgest 2.8.2 / 2.8.6u
mingw32-gcc-3.4.2 / gcc 4.1.2
wxDev-CPP beta 6.10.2 / Anjuta
Dev-CPP (4.9.9.2)
XP Pro / Vista / Feodra 8
I have since taken the executable from the computer I have been developing on and run it on other computers - and it adjusted to the timezone correctly.
The Windows XP installation on this computer is about five and a half years old - somehow this bug has been introduced into the operating system either by an update or something I installed during that time.
The Windows XP installation on this computer is about five and a half years old - somehow this bug has been introduced into the operating system either by an update or something I installed during that time.