Skip navigation

JSI Tip 0398 - How to set the time zone by editing the registry.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
Value Type Description
Bias REG_DWORD Negative offset from GMT in minutes.
StandardName REG_SZ Standard name of this time zone.
StandardBias REG_DWORD Offset applied to Bias for Standard Time.
StandardStart REG_BINARY A coded year, month, day of week, week, hour, minute, second, and millisecond of when the switch to Stand Time occurs. This is detailed at the end of the tip.
DaylightName REG_SZ Standard name for Daylight time.
DaylightBias REG_DWORD Offset applied to StandardBias wich is applied toBias for Daylight Time.
DaylightStart REG_BINARY A coded year, month, day of week, week, hour, minute, second, and millisecond of when the switch to Daylight Time occurs. This is detailed at the end of the tip.
ActiveTimeBias REG_WORD The currently active offset from GMT.

If your browse to your time zone starting at:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zones

you will find Display contains your StandardName, DLT contains your DaylightName, and TZI contains everything else. Here is the TZI for Western Europe Standard Time and its' meaning:

C4 FF FF FF 00 00 00 00 C4 FF FF FF 00 00 0A 00 00 00 05 00 03 00 00 00 00 00 00 00 00 00 03 00 00 00 05 00 02 00 00 00 00 00 00 00

TDI Bytes Hex Value Decimal Meaning
C4 FF FF FF ffffffc4 -60 Bias
00 00 00 00 00000000 0 StandardBias
C4 FF FF FF ffffffc4 -60 DaylightBias
00 00 0A 00 00 00 05 00 03 00 00 00 00 00 00 00 Switch to Standard time (last Sun in Oct, 3:00 am)   StandardStart
00 00 03 00 00 00 05 00 02 00 00 00 00 00 00 00 Switch to Daylight time (last Sun in March, 2:00 am)   DaylightStart

Where (looking at StandardStart)
00 00 - is the Year from a 1900 time base.
0A 00 - The first byte is the Month (January is 01).
00 00 - The first byte is the DayOfWeek (Sunday=0).
05 00 - The first byte is the Week (starts at 1 and 5 means last).
03 00 - The first byte is the Hour.
00 00 - The fist byte is the Minute.
00 00 - The first byte is the Seconds.
00 00 - the first byte is the Millisecond.

If no switch to/from DST is required, Month is 0.
If the switch happens on a date specified in absolute terms, Year not = 0, then all the fields are the date when the switchover happens.
If the switch date is variable, Year = 0, then Month is the month for the switch, DayOfWeek is the weekday, and Week selects the Nth occurrence of the specified weekday within the month.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish