[tz] strftime %s

Brooks Harris brooks at edlmax.com
Mon Jan 15 22:03:20 UTC 2024


On 1/15/2024 4:43 PM, Guy Harris wrote:
> On Jan 15, 2024, at 11:38 AM, Brooks Harris via tz <tz at iana.org> wrote:
>
>> The problem was that __mktime_internal () was comparing only isdst where it also needed to compare Abbr, as explained more in comments in the attached modified code.
> Presumably you do not mean that it must compare the value of tm_zone, as there is no guarantee whatsoever that the caller of mktime() has set tm_zone.
The modifications I made do indeed presume tm_zone is set correctly.

The use case I was addressing was where localtime() was populating 
struct tm so tm_zone is set. And that's really the only
use I've put it to and wouldn't really trust using it in other uses that 
have not set tm_zone or tm_idst and such. In the cases I've described I 
think the modifications improve the results.

But I'm learning from this email thread others do expect to use it in 
other ways and that the specifications allow that. This was not 
considered. I only looked to fix the fact mktime() did not always return 
the time_t given to localtime().





More information about the tz mailing list