Welcome to The Emission Locus Sign in | Join | Help

A gotcha with the SetLocalTime API

Its been a long time between posts; I've been consumed by the tail end of a major project, including a number of longer-than-expected overseas trips. Anyway, to the issue at hand:

If your code calls SetLocalTime take special note of the documentation in recent versions of the PSDK (and also mentioned in MSKB article 234735):

"The system uses UTC internally. Therefore, when you call SetLocalTime, the system uses the current time zone information to perform the conversion, including the daylight saving time setting. Note that the system uses the daylight saving time setting of the current time, not the new time you are setting. Therefore, to ensure the correct result, call SetLocalTime a second time, now that the first call has updated the daylight saving time setting."

This tripped one of my test cases for an embedded application that may adjust the system time.

Published Monday, July 03, 2006 4:59 AM by john
Filed under: , ,

Comments

Anonymous comments are disabled