From owner-freebsd-bugs Tue Sep 4 17:50: 5 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 3EBC137B407 for ; Tue, 4 Sep 2001 17:50:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f850o2N94250; Tue, 4 Sep 2001 17:50:02 -0700 (PDT) (envelope-from gnats) Date: Tue, 4 Sep 2001 17:50:02 -0700 (PDT) Message-Id: <200109050050.f850o2N94250@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Garrett Wollman Subject: Re: bin/30321: strftime(3) '%s' format does not work properly Reply-To: Garrett Wollman Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/30321; it has been noted by GNATS. From: Garrett Wollman To: Archie Cobbs Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/30321: strftime(3) '%s' format does not work properly Date: Tue, 4 Sep 2001 20:46:42 -0400 (EDT) < said: > For example, if you use '%z' you get the time zone offset read > directly from the struct tm; the system time zone has no effect on > that conversion whatsoever. This is a bug. POSIX says that ``Local timezone information is used as though strftime( ) called tzset( ).'' POSIX does not appear to permit the implementation to require initialization of non-standard fields in `struct tm' for strftime() to work. I would interpret the specification as requiring that strftime() always use the ``system'' timezone. In order for our implementation to meet the specification, we need to call mktime() on a copy of the input structure in order to determine the timezone to generate for `%z' and `%Z'. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message