From owner-freebsd-ports Sat Jul 20 09:50:52 1996 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id JAA24606 for ports-outgoing; Sat, 20 Jul 1996 09:50:52 -0700 (PDT) Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id JAA24593; Sat, 20 Jul 1996 09:50:47 -0700 (PDT) Received: from sax.sax.de by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id SAA24717; Sat, 20 Jul 1996 18:50:43 +0200 Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id SAA29613; Sat, 20 Jul 1996 18:50:43 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.7.5/8.6.9) id SAA04892; Sat, 20 Jul 1996 18:39:41 +0200 (MET DST) From: J Wunsch Message-Id: <199607201639.SAA04892@uriah.heep.sax.de> Subject: Re: One question about tm_gmtoff To: csdayton@midway.uchicago.edu Date: Sat, 20 Jul 1996 18:39:41 +0200 (MET DST) Cc: freebsd-ports@freebsd.org, freebsd-hackers@freebsd.org Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199607201519.KAA24959@woodlawn.uchicago.edu> from Soren Dayton at "Jul 20, 96 10:19:04 am" X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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. ;-)