A NOTE has been added to this issue. ====================================================================== http://austingroupbugs.net/view.php?id=1125 ====================================================================== Reported By: Florian Weimer Assigned To: ====================================================================== Project: 1003.1(2016)/Issue7+TC2 Issue ID: 1125 Category: Base Definitions and Headers Type: Clarification Requested Severity: Editorial Priority: normal Status: New Name: Florian Weimer Organization: Red Hat User Reference: https://sourceware.org/bugzilla/show_bug.cgi?id=21229 Section: strftime, strftime_l Page Number: unknown Line Number: unknown Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2017-03-07 11:24 UTC Last Modified: 2017-03-07 15:52 UTC ====================================================================== Summary: Do strftime, strftime_l set tzname, daylight, timezone? ======================================================================
---------------------------------------------------------------------- (0003611) geoffclare (manager) - 2017-03-07 15:52 http://austingroupbugs.net/view.php?id=1125#c3611 ---------------------------------------------------------------------- The intention is that strftime() must update tzname[]. This was stated explicitly in POSIX.1-1990 and POSIX.1-1996 in section 8.1.1 after the description of the TZ rules:<blockquote>Whenever ctime(), strftime(), mktime(), or localtime() is called, the time zone names contained in the external variable tzname shall be set as if the tzset() function had been called.</blockquote> However, the merge with SUS in 2001 did not retain this statement with the TZ description in XBD, instead relying on the "as though" statements in the individual function descriptions. There is also this statement in the tzset() APPLICATION USAGE section:<blockquote>Since the ctime(), localtime(), mktime(), strftime(), and strftime_l() functions are required to set timezone information as if by calling tzset(), there is no need for an explicit tzset() call before using these functions. However, portable applications should call tzset() explicitly before using ctime_r() or localtime_r() because setting timezone information is optional for those functions.</blockquote> Note that the "as though" wording on the strftime() page is exactly the same as on the localtime() page, and I assume nobody would question the requirement for localtime() to set tzname[]. Interestingly, the mktime() page has slightly different wording:<blockquote>Local timezone information shall be set as though mktime() called tzset().</blockquote> I suggest that we should change the localtime() and strftime() pages to use this wording. Issue History Date Modified Username Field Change ====================================================================== 2017-03-07 11:24 Florian Weimer New Issue 2017-03-07 11:24 Florian Weimer Name => Florian Weimer 2017-03-07 11:24 Florian Weimer Organization => Red Hat 2017-03-07 11:24 Florian Weimer User Reference => https://sourceware.org/bugzilla/show_bug.cgi?id=21229 2017-03-07 11:24 Florian Weimer Section => strftime, strftime_l 2017-03-07 11:24 Florian Weimer Page Number => unknown 2017-03-07 11:24 Florian Weimer Line Number => unknown 2017-03-07 15:52 geoffclare Note Added: 0003611 ======================================================================