This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug time/17189] Incorrect result for %s in strftime


https://sourceware.org/bugzilla/show_bug.cgi?id=17189

--- Comment #2 from daurnimator <quae at daurnimator dot com> ---
> This is the documented behavior in the manual:

> Calling 'strftime' also sets the current time zone as if 'tzset'
> were called; 'strftime' uses this information instead of
> BROKENTIME's 'tm_gmtoff' and 'tm_zone' members.

The %s specifier is defined as printing the **UTC timestamp**. From the man
page:

       %s     The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000
(UTC). (TZ)

In reality, it prints the UTC timestamp, but adjusted for the local time
offset.
This is wrong (and not as documented)
At the very least this means we have a documentation bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]