Solved

Get windows time zone

Posted on 1998-08-30
1
168 Views
Last Modified: 2010-04-16
How can I get the time zone set on a PC.
0
Comment
Question by:moonrise
1 Comment
 
LVL 8

Accepted Solution

by:
ZifNab earned 30 total points
ID: 1338140
hi moonrise :

>HKEYLocal Machine/Software/Microsoft/Windows/CurrentVersion/TimeZones/
>
>is the place where Timezone infos are stored in the registry. The
>binary 'TZI' entry should be the info for start and end times of
>daylight saving times. Anyone has an idea how to extract the dates
>from this value?
>

The TZI entry seems to be structured as follows:

int32 Bias;             // Minutes from GMT
                        // (Sydney -600; 0xfffffda8;
                        // or a8, fd, ff, ff)
int32 StandardBias;     // Bias for Standard time (0)
int32 DaylightBias;     // Bias for Daylight time (-60
                        // or 0xffffffc4 )
int16 ??                          // 0
int16 StandardStartMonth;         // 3 => March
int16 StandardStartDayOfWeek??;   // 0 => Sun
int16 StandardStartDOWoccurrence; // 1 => 1st
int16 StandardStartHour;          // 2 => 02:00:00.00
int16 StandardStartMins??;        // 0 => 02:00:00.00
int16 StandardStartSecs??;        // 0 => 02:00:00.00
int16 StandardStartHunds??;       // 0 => 02:00:00.00
int16 ??                          // 0
int16 DaylightStartMonth;         // 0x0a (10) => October
int16 DaylightStartDayOfWeek??;   // 0 => Sun
int16 DaylightStartDOWoccurrence; // 5 => last
int16 DaylightStartHour;          // 2 => 02:00:00.00
int16 DaylightStartMins??;        // 0 => 02:00:00.00
int16 DaylightStartSecs??;        // 0 => 02:00:00.00
int16 DaylightStartHunds??;       // 0 => 02:00:00.00

or use the GetTimeZoneInformation() Api.

The constants for the return values for the Windows API function GetTimeZoneInformation() are

const TIME_ZONE_ID_UNKNOWN  =  0;
const TIME_ZONE_ID_STANDARD =  1;
const TIME_ZONE_ID_DAYLIGHT =  2;


Regards, Zif.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question