From: Erez Steinberg Subject: Re: timezone Date: 06 Oct 1999 00:00:00 GMT Message-ID: <37FBC0FF.86E92E2A@attglobal.net> Content-Transfer-Encoding: 8bit References: <9XNK3.5194$cPf.198179328@news.telia.no> To: ^applez^ X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: postmaster@ibm.net X-Trace: news.ibm.net.il!ibm.net 939245922 27554 (none) 139.92.182.156 Organization: Unspecified Organization Mime-Version: 1.0 Reply-To: erezst@attglobal.net Newsgroups: alt.lang.delphi Win32Api can help you do the trick. Use GetTimeZoneInformation to get time-zone info. The GetTimeZoneInformation function retrieves the current time-zone parameters. These parameters control the translations between Coordinated Universal Time (UTC) and local time. DWORD GetTimeZoneInformation(     LPTIME_ZONE_INFORMATION  lpTimeZoneInformation  // address of time-zone settings    ); Parameters lpTimeZoneInformation Points to a TIME_ZONE_INFORMATION structure to receive the current time-zone parameters.   Return Value If the function succeeds, the return value is one of the following values: Value Meaning TIME_ZONE_ID_UNKNOWN The operating system cannot determine the current time zone. This is usually because a previous call to the SetTimeZoneInformation function supplied only the bias (and no transition dates). TIME_ZONE_ID_STANDARD The operating system is operating in the range covered by the StandardDate member of the structure pointed to by the lpTimeZoneInformation parameter. TIME_ZONE_ID_DAYLIGHT The operating system is operating in the range covered by the DaylightDate member of the structure pointed to by the lpTimeZoneInformation parameter. If the function fails, the return value is 0xFFFFFFFF. To get extended error information, call GetLastError. Remarks All translations between UTC time and local time are based on the following formula: UTC = local time + bias   The bias is the difference, in minutes, between UTC time and local time. ********* typedef struct _TIME_ZONE_INFORMATION { // tzi     LONG       Bias;     WCHAR      StandardName[ 32 ];     SYSTEMTIME StandardDate;     LONG       StandardBias;     WCHAR      DaylightName[ 32 ];     SYSTEMTIME DaylightDate;     LONG       DaylightBias; } TIME_ZONE_INFORMATION;   The TIME_ZONE_INFORMATION structure specifies information specific to the time zone. Members Bias Specifies the current bias, in minutes, for local time translation on this computer. The bias is the difference, in minutes, between Coordinated Universal Time (UTC) and local time. All translations between UTC and local time are based on the following formula: UTC = local time + bias   This member is required. StandardName Specifies a null-terminated string associated with standard time on this operating system. For example, this parameter could contain "EST" to indicate Eastern Standard Time. This string is not used by the operating system, so anything stored there by using the SetTimeZoneInformation function is returned unchanged by the GetTimeZoneInformation function. This string can be empty. StandardDate Specifies a SYSTEMTIME structure that contains a date and UTC when the transition from daylight time to standard time occurs on this operating system. If this date is not specified, the wMonth member in the SYSTEMTIME structure must be zero. If this date is specified, the DaylightDate value in the TIME_ZONE_INFORMATION structure must also be specified. Local time translations done during the standard-time range are relative to the supplied StandardBias value. This member supports two date formats. Absolute format specifies an exact date and time when standard time begins. In this form, the wYear, wMonth, wDay, wHour, wMinute, wSecond, and wMilliseconds members of the SYSTEMTIME structure are used to specify an exact date. Day-in-month format is specified by setting the wYear member to zero, setting the wDayOfWeek member to an appropriate weekday, and using a wDay value in the range 1 through 5 to select the correct day in the month. Using this notation, the first Sunday in April can be specified, as can the last Thursday in October (5 is equal to "the last"). StandardBias Specifies a bias value to be used during local time translations that occur during standard time. This member is ignored if a value for the StandardDate member is not supplied. This value is added to the value of the Bias member to form the bias used during standard time. In most time zones, the value of this member is zero. DaylightName Specifies a null-terminated string associated with daylight time on this operating system. For example, this parameter could contain "PDT" to indicate Pacific Daylight Time. This string is not used by the operating system, so anything stored there by using the SetTimeZoneInformation function is returned unchanged by the GetTimeZoneInformation function. This string can be empty. DaylightDate Specifies a SYSTEMTIME structure that contains a date and UTC when the transition from standard time to daylight time occurs on this operating system. If this date is not specified, the wMonth member in the SYSTEMTIME structure must be zero. If this date is specified, the StandardDate value in the TIME_ZONE_INFORMATION structure must also be specified. Local time translations during the daylight-time range are relative to the supplied DaylightBias value. This member supports the absolute and day-in-month time formats described for the StandardDate member. DaylightBias Specifies a bias value to be used during local time translations that occur during daylight time. This member is ignored if a value for the DaylightDate member is not supplied. This value is added to the value of the Bias member to form the bias used during daylight time. In most time zones, the value of this member is  - 60.   Erez Steinberg, erezst@ibm.net   ^applez^ wrote: > How can i display the time of different timezones? > any help apriciated! > Sorcerer^ > http://come.to/applez/ > > "Programming with C++ is like programming with Sand. >     You can build Bricks (in 3 days) >     You can use Bricks to build Walls (after weeks) >     You can use Walls to build Rooms (after months) >     With Delphi you are programming with Rooms >     You can use Rooms to Build Houses (in 15 minutes) " > quote from "The xploiter delphi tutorial"