On Sunday, January 21 2018, "Robert Elz" wrote to "eggert@cs.ucla.edu, tz@iana.org, jsm@polyomino.org.uk" saying:
| If tm_zone is a pointer, its lifetime | would be that of the corresponding timezone_t object
Agreed. For the majority of programs that don't call tzset, that means for the lifetime of the program. For those that do, it is easy to manage.
This corresponds to the definition of strftime "%Z" in POSIX: If a struct tm broken-down time structure is created by localtime() or localtime_r(), or modified by mktime(), and the value of TZ is subsequently modified, the results of the %Z and %z strftime() conversion specifiers are undefined, when strftime() is called with such a broken-down time structure. http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html The reason it's "undefined" (as opposed to "unspecified") is specifically to handle the case where struct tm has tm_zone, and %Z is populated from it. -- Jonathan Lennox lennox@cs.columbia.edu