Solved

Get windows time zone

Posted on 1998-08-30
1
166 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

862 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now