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

Jerold Schulman

January 20, 1998

2 Min Read
ITPro Today logo in a gray background | ITPro Today
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTimeZoneInformation

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_MACHINESoftwareMicrosoftWindows NTCurrentVersionTime 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

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.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like