FW: Questions

Michel Bourget michel at sgi.com
Wed Apr 4 19:38:31 UTC 2007

On Wed, 2007-04-04 at 10:41 -0700, Paul Eggert wrote:
> Fan_Zhenqiang at emc.com writes:
> > What if a time zone is specified together with the date/time value? For
> > instance, is there any function that call whether "2007-11-04 01:30 PST"
> > is DST?
> Sorry, no; in general that's not possible, as in some locations the
> same abbreviation is used for both standard and daylight time.  One
> could do a reasonable job in most cases, as in the other problems you
> mentioned; it shouldn't be that hard, but the functions aren't there
> now.

Bottom line, you need to know the *context*( the geographic location )
of the date, hence the Country/City TZ value information, and not the
abbreviation ( DST, PST, WAT, ... ). Then, as explained earlier, use
localtime() returned 'struct tm'->tm_isdst value. Unfortunately, the %Z
format still gives the abbreviation, not the time zone itself. 

Briefly. To compute isdst, you need date and TZ( not its abbreviation ).

 Me:     If I can , I want.
 Not me: If I want, I can.
 A boss: If I want, you can.

More information about the tz mailing list