Jaa


Daylight Savings Time in WinPE

A number of WinPE enthusiasts have expressed concern that Daylight Savings Time (DST) is not supported in WinPE.  DST is the practice of setting clocks forward one hour in the spring and back one hour in the fall.  WinPE ignores DST, so if you are running your WinPE system during a transition period the time reported by the computer won't change (and will become incorrect).

Although we periodically hear complaints about this, we can't implement DST in WinPE for technical reasons stemming from the way Windows uses the BIOS clock to store time.  For historical reasons, Windows keeps the BIOS clock set to local time.  When it first runs after daylight savings time begins, Windows will update the BIOS clock with the new time and set a flag in the registry to mark that DST is enabled.  The prevents Windows from setting the clock forward more than once.

In WinPE, the registry does not preserve changes across reboots.  This leaves us with two choices if we insist on enabling DST.  We could either leave the flag unchanged, which means WinPE would set your BIOS clock forward every reboot for a period after the spring transition.  Alternately, we could set the flag permanently in the offline WinPE image, which would cause WinPE to set the BIOS clock backwards every reboot for a period after the fall transition.  Either option is less desirable than just not touching the BIOS clock at all, which is the solution we ended up with.

If the BIOS clock of a Windows computer is already in local time, why must you set the timezone of an offline WinPE image?  As it turns out, NTFS keeps its own timestamps in UTC, which it calculates by subtracting the timezone offset from the local time in the BIOS clock. If you fail to correctly set the timezone offset, your NTFS timestamps (such as file creation or modification) will be incorrect.

For more information about how Windows keeps time, see this entry on Raymond Chen's blog:

https://blogs.msdn.com/oldnewthing/archive/2004/09/02/224672.aspx

Comments

  • Anonymous
    December 04, 2010
    You're missing the third choice. Have the WinPE environment note the date/time. It'll assume your regular Windows installation has already set the BIOS clock to DST time. WinPE then sets the flag and DST checkbox internally to DST when applicable, but without updating the BIOS clock. Thus the WinPE environment will be able to report to applications if it is currently in DST or not, without affecting the BIOS clock in any way. The only con of this approach is that there would need to be a modification to some system files for it to know when it's running from a ROM-type media (i.e registry changes aren't kept), or a PE environment., so it knows when not to set the time (unless manually set, of course).