tags:

views:

271

answers:

1

My XP system with service pack 2 seems to have transitioned to normal non-daylight time BUT the C++ time routines have not. The Date and Time Properties tool tells me it is now 5:26AM CST BUT localtime() and strftime() think it is 6:26CDT. I have relinked the app and restarted the system since the daylight switch to no avail. If I unclick the 'Automatically adjust clock for daylight saving changes' check box in the Date and Time Properties Time Zone tab, the c++ routines return the CST values. I admittedly do have an old 2002 XP and Visual Studio.

+1  A: 

Probably the actual answer

Ah you have a much older version of Win XP. I suspect you do not have a version of Windows XP that was updated to the latest DST dates (they changed in 2007) or somehow its not functioning correctly. I would look into this hotfix.

Here's a blog post about the changes for the CRT

Doug T.
Huh? I did and that's the problem! tm_isdst is returned as one even though it is NOT DST.
Mike D
oh! lol. that's interesting.
Doug T.
@Doug: GetTimeZoneInformation returns the proper bias of 360 minutes for my time zone regardless of the setting of the 'Automatically adjust clock for daylight saving changes' check box in the Date and Time Properties Time Zone tab.
Mike D
@Doug: I donwloaded and tried to install the update and got the msg "Update cannot be installed as a newer or same timezone update has already been installed on the system"
Mike D
@Doug: Could this be a run time library problem? How could I get a copy of Localtim.c?
Mike D
Yes it could be a run time library problem... If I recall it may have taken MS a few tries to get this DST change right.
Doug T.