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