Setting tm_gmtoff "fixes" it. Should I call mktime before passing tm struct into strftime? Or assumption here is "garbage in - garbage out"? It was unexpected to me and it is not clear from man pages. Also, as strftime has no way of indicating error [1], is there any downside of "doing the right thing" (tm) and instead of using user provided tm_gmtoff get it from mktime call? Yep, there is tm_gmtoff in MacOs. Moreover, its strftime implementation ignores any garbage value stored there and puts the correct value into the passed array. [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html On Mon, 18 Jul 2022 at 10:04, Guy Harris via tz <tz@iana.org> wrote:
On Jul 18, 2022, at 1:44 AM, Andreas Schwab via tz <tz@iana.org> wrote:
You are not setting tm_gmtoff, thus it remains at zero. MacOS probably doesn't have tm_gmtoff.
Given that it's derived from, among other sources, various 4.4-Lite-derived BSDs, macOS most definitely *does* have tm_gmtoff.