Welcome to MSDN Blogs Sign in | Join | Help

USA Daylight Savings Time (DST) Update

Starting from March 2007, the Daylight Savings Time (DST) start date and end date for the United States will change. DST will start at 2:00 A.M. on the second Sunday in March and end at 2:00 A.M on the first Sunday in November.

The C Run-Time (CRT) performs its own time handling only when the TZ environment variable is set, or when an underlying OS API time call fails.  If the TZ environment variably is not set, the CRT calls the Windows APIs and exhibits Windows behavior. Windows Updates are available which allow Windows to correctly calculate time based on the new DST rules. CRT Updates are available for the CRTs which ship with every currently supported version of Visual Studio and  CRT updates are also available for the CRT which ships with Windows to continue to correctly handle DST conversions in U.S. time zones based on the new DST rules.

Get more information on Preparing for Daylight Saving Time changes in 2007

Get more information on How to handle dates and times that include DST

Thanks,

Sarita Bafna - Visual C++ Team

Published Thursday, March 08, 2007 1:01 PM by vcblog

Comments

Friday, March 09, 2007 2:07 PM by nativecpp

# re: USA Daylight Savings Time (DST) Update

I understnad that the information is saved under hklc\software\microsoft\windows nt\currentversion\time zones in XP. You indicated that "If the TZ environment variably is not set, the CRT calls the Windows APIs and exhibits Windows behavior". My questions:

1) What is the API ?

2) Is the API go to this registry to get the info ?

Thnks

Friday, March 09, 2007 2:12 PM by Ben Anderson

# re: USA Daylight Savings Time (DST) Update

You should check the CRT sources to be sure (VC\crt\...), but I believe the API called is GetTimeZoneInformation

Friday, March 09, 2007 6:41 PM by nativecpp

# re: USA Daylight Savings Time (DST) Update

I believe my crt is *NOT* up-to-date because the version is 7.0.2600.2180 and NOT 7.0.2600.3085 as indicated in the VC++ runtime fixes (because I have *NOT* installed Visual Studio 2005 sp1). However, it seems that the O/S has been updated to reflect the DST changes. I am just wondering how does O/S get DST info:

1) Does it get the info directly from registry ? or

2) Does it call some API ? If it does, what API is it calling and which DLL? I would assume that it is *NOT* calling from crt because my crt has *NOT* been updated ?

Thanks

Friday, March 09, 2007 8:10 PM by grmileka

# re: USA Daylight Savings Time (DST) Update

The CRT has been always calling GetTimeZoneInformation() (as long as the environment variable TZ is not defined). The file you might want to look at is tzset.c.

The OS patch for DST fixes how this API works - and hence anybody who's calling it will get the right information for 2007 and beyond. So, CRT gets that for free (again, if TZ is not defined).

The new DST information is stored in the registry. You might want to check the following link to know about the registry structure:

http://msdn2.microsoft.com/en-us/library/ms724253.aspx

Monday, March 12, 2007 5:57 PM by nativecpp

# re: USA Daylight Savings Time (DST) Update

Thanks for the reply. I can see that in tzset.c, GetTimeZoneInformation is being called when TZ is off. I am trying to understand why when TZ is off, crt library needed to update.

Can you elaborate more as far as which part of the code is wrong?

Thanks

Monday, March 12, 2007 6:33 PM by nativecpp

# re: USA Daylight Savings Time (DST) Update

I meant when tz is on that crt needed update

Friday, March 23, 2007 12:52 PM by Craig West

# re: USA Daylight Savings Time (DST) Update

The download pages for the Visual Studio hotfixes have broken links, at least for 2003 and 2003 SP1. I haven't checked the others yet

Tuesday, April 03, 2007 8:53 PM by xiaoxinwow

# re: USA Daylight Savings Time (DST) Update

Welcome to our website for you World of Warcraft Gold,Wow Gold,Cheap World of Warcraft Gold,cheap wow gold,buy cheap wow gold,real wow gold,<a href="http://www.power-levels.com/"><strong>Power Leveling</strong></a> sell wow gold, ...Here wow gold of 1000 gold at $68.99-$80.99  ,World Of Warcraft Gold,buy wow gold,sell world of warcraft gold(wow gold),buy euro gold wow Cheap wow gold,cheapest<strong> Power Leveling</strong> wow gold store ... buy euro gold wow wow gold--buy cheap wow gold,sell wow gold.welcome to buy cheap wow gold--cheap, easy, wow gold purchasing.World of Warcraft,wow gold Super ...

 We can have your wow gold,buy wow gold,wow gold game,world of warcraft gold, wow Gold Cheap wow, Cheap wow gold,world of warcraft gold deal,<strong>Power Leveling</strong> Cheap WOW Gold ...Welcome to our website for you World of Warcraft Gold,Wow Gold,Cheap World of Warcraft Gold,wow gold,buy cheap wow gold,real wow gold,sell wow gold, ...  Here wow gold of 1000 gold at $68.99-$80.99,World Of Warcraft Gold,buy wow gold,sell world of warcraft gold(wow gold),buy gold wow lightninghoof instock <a href="http://www.power-levels.com"><strong>Power Level</strong></a> Cheap wow gold,cheapest wow gold store ...  wow gold--buy cheap wow gold,sell wow gold.welcome to buy cheap wow gold--cheap, easy, wow gold purchasing.World of Warcraft,wow gold Super ...<strong>Power Level</strong> Wow gold- Gold for buy gold wow lightninghoof instock EU-Server: ...wow Gold EU: starting from 84,99?; 3000 WoW Gold EU: starting from 119,99?. wow Gold- Leveling Services: ...We can have your wow Gold,buy wow Gold,wow Gold game,wow gold, Cheap wow Gold, Cheap World of Warcraft Gold,<strong>Power Level</strong> world of warcraft gold deal,buy cheap wow gold,Cheap WOW Gold ...Here wow Gold of 1000 gold at $68.99-$80.99,World Of Warcraft Gold,buy wow Gold,sell world of warcraft gold(wow gold),Cheap wow gold,cheapest World of Warcraft Gold store ...

New Comments to this post are disabled
 
Page view tracker