System Time Zone Information

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

 

Available Now

Search

Google
 

Search WWW             

Search delphiforfun.org

Contact

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

Help 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.

 

Google
 

Search WWW

Search delphiforfun.org

 

 

 

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:

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

The function also returns an integer result indicating:

  • Information not available
  • We are in daylight savings time
  • We 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: February 01, 2007

 

 

 

 

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