Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jul 1996 18:39:41 +0200 (MET DST)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        csdayton@midway.uchicago.edu
Cc:        freebsd-ports@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: One question about tm_gmtoff
Message-ID:  <199607201639.SAA04892@uriah.heep.sax.de>
In-Reply-To: <199607201519.KAA24959@woodlawn.uchicago.edu> from Soren Dayton at "Jul 20, 96 10:19:04 am"

next in thread | previous in thread | raw e-mail | index | archive | help
As Soren Dayton wrote:

> an extern long timezone. The SunOS manpage for ctime, tzset, etc claims
> that the proper way to get this information is to use the tm_gmtoff
> field of the tm struct.  The problem I have is that they do not agree.
> i also get the same results (timezone on an svr4 machien in the same
> timezone agrees with the SunOS machine and tm_gmtoff agrees with my
> FreeBSD machine).  (in Chicago timezone says 21600 and tm_gmtoff says
> -18000).  So what is the relation between these two?

It looks like a confused +/- sign, and confusion about whether to
apply the DST offset or not.  For tm_gmtoff, the man page clearly
describes that it is positive for east of the null meridian, and it
apparently has the DST offset applied.  There's no defined way to
learn about the current DST offset at all, you can only guess that it
might be 3600 seconds.

I think it were better off with using gmtime() instead of localtime().

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607201639.SAA04892>