[tz] Buggy %z behaviour in strftime

Paul Eggert eggert at cs.ucla.edu
Thu Jul 21 18:21:18 UTC 2022

On 7/21/22 04:25, Almaz Mingaleev wrote:
> Just to make sure I understand it correctly: does it mean that %z will be
> replaced by offset used by a time zone at a time specified by tm struct and
> TZ env variable so developer won't be able to get DST offset at a time
> when standard time is in effect as specified methods override tm_isdst
> field?
> Or setting the tm_isdst field to the opposite value _after_ any of these
> calls
> should also change the way strftime behaves?

The former (if I understand you correctly). Platforms that have 
tm_gmtoff can use its value and ignore tm_isdst's value when 
interpreting %z.

> My understanding of the proposed fix is that users won't be able to get DST
> time when standard is used and vice-versa. That removes ambiguity around
> certain dates at some time zones, I like that.

Yes, that's the idea.

More information about the tz mailing list