System Time Zone Information

[Home]   [Puzzles & Projects]    [Delphi Techniques]   [Math Topics]   [Library]   [Utilities]

Search

 

Search DelphiForFun.org only

Support DFF

 

If you shop at Amazon anyway,  consider using this link. We receive a few cents from each purchase.   Thanks.

In Association with Amazon.com

 

Support DFF

 If you benefit from the website,  in terms of knowledge, entertainment value, or something otherwise useful, consider making a donation via PayPal  to help defray the costs.  (No PayPal account necessary to donate via credit card.)  Transaction is secure.

 

 

Contact

Feedback:  Send an e-mail with your comments about this program (or anything else).

 

Search DelphiForFun.org only

 

 

 

 

 

I needed time zone adjustment information for a current project, so decided to write a separate program to explore what is available.  Since we identify our time zone to  Windows at installation time and since it politely asks us to confirm when when it changes the clock for daylight savings time, it seems logical that the information would be available.  Sure enough Windows API function GetTimeZoneInformation returns a record, TTimeZoneInformation,  with everything you would want to know; Specifically:

bulletBias - the offset in minutes to add to local time  to get UTC (Universal Time Coordinated, also/formerly known as GMT, Greenwich Mean Time).  
bulletTime zone name
bulletDaylight savings name
bulletDate and time for start of Daylight savings time
bulletDate and time for end of Daylight savings time
bulletDaylight savings time adjustment amount

The function also returns an integer result indicating:

bulletInformation not available
bulletWe are in daylight savings time
bulletWe are not in daylight savings time

Delphi provides both the hook to the function and the record definition.  Here is a simple program that just calls GetTimeZoneInformation  and displays the results.

Download source

Download executable

Created: January 25, 2004

Modified: November 07, 2008

 

 

 

 

  [Feedback]   [Newsletters (subscribe/view)] [About me]
Copyright © 2000-2011, Gary Darby    All rights reserved.