On Thu, 5 Feb 2004, Jamie LeTual wrote:

> The following C code will get the "windowsified time zone (i.e.
> 'Atlantic Standard Time')
>
> #include <stdio.h>
> #include <time.h>
>
> int main(int argc, char **argv)
> {
>       _tzset();
>       printf("tzname 0: %s\n",_tzname[0]);
>       printf("tzname 1: %s\n",_tzname[1]);
>
> }
>
> You need the call to _tzset() to initialize the values in _tzname[].
>
> The msdn doc says that _tzname[0] is derived from the TZ environment
> variable, and that _tzname[1] defaults to PDT, and if the DST isn't set,
> its an empty string.

Where does Windows store the setting given by the user when they adjust
the clock applet on the status bar?

> When I ran that just now, both contained "Atlantic Standard Time"
> (without the quotes).
>
> Also, after calling _tzset(), two other globals are populated,
> int _daylight = 0 || 1 (like isDst)
> long _timezone = difference in seconds between coordinated universal
> time and localtime (defaults to 28,000; presumably thats PDT).

The problem is that DateTime wants something like "America/New_York", not
"Atlantic Standard Time", whichi isn't really the right timezone, most
likely.  AST, which is probably the same as EST, is only valid for half of
the year on most of the US Atlantic coast.

So we don't want to know what the current offset is, instead we want to
know the geo-political time zone name.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to