?
Solved

Get windows time zone

Posted on 1998-08-30
1
Medium Priority
?
185 Views
Last Modified: 2010-04-16
How can I get the time zone set on a PC.
0
Comment
Question by:moonrise
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
ZifNab earned 120 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

762 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