Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Sep 2001 16:50:01 -0700 (PDT)
From:      Archie Cobbs <archie@packetdesign.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/30321: strftime(3) '%s' format does not work properly
Message-ID:  <200109042350.f84No1a82317@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/30321; it has been noted by GNATS.

From: Archie Cobbs <archie@packetdesign.com>
To: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/30321: strftime(3) '%s' format does not work properly
Date: Tue, 04 Sep 2001 16:42:38 -0700

 Garrett Wollman wrote:
 > >       When it does this conversion, it uses the currently set
 > >       system time zone instead of using the time zone from the
 > >       'struct tm' argument. Therefore, if the two timezones are
 > >       different, incorrect results are computed.
 > 
 > This behavior is correct.  In the general case, as codified in the ISO
 > C standard, `struct tm' does not contain time zone information.  ISO C
 > functions such as strftime() are specified to use the system's time
 > zone.
 
 The current behavior of '%s' is inconsistent with every other
 format character supported by strftime(3). 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.
 Same for '%H', etc.
 
 So at best, it violates POLA and is bizarre, undocumented behavior.
 
 -Archie
 
 __________________________________________________________________________
 Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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