mailing list of musl libc
 help / color / mirror / code / Atom feed
* Re: [musl] Possible issue formatting epoch time with strftime()
       [not found] <70c350e5-78cd-4ab9-ae9b-598179ee4f8e@pgbackrest.org>
@ 2025-06-03 15:03 ` Markus Wichmann
  2025-06-03 21:52   ` David Steele
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Wichmann @ 2025-06-03 15:03 UTC (permalink / raw)
  To: musl; +Cc: David Steele

Am Mon, Jun 02, 2025 at 07:33:41PM +0000 schrieb David Steele:
> Ubuntu 22.04 (UTC) gcc:
> 
> local epoch: 1573222014
> utc epoch: 1573240014
> local time: 20191108-090654
> utc time: 20191108-140654
> 
> [...]
> 
> Alpine 3.21 (America/New_York or UTC) gcc/musl:
> 
> local epoch: 1573222014
> utc epoch: 1573222014        <------
> local time: 20191108-090654
> utc time: 20191108-140654
> 

I think what happened here is that musl is currently implementing
non-standard extension behavior that is no longer conforming as of last
year. My reading of POSIX-2024 is that strftime() is to treat the
incoming timestamp as local time, at least for the purpose of a %s
conversion.  Which it isn't at the moment. But POSIX-2018 did not
specify %s at all, so musl was allowed to do whatever until POSIX-2024.

Ciao,
Markus

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [musl] Possible issue formatting epoch time with strftime()
  2025-06-03 15:03 ` [musl] Possible issue formatting epoch time with strftime() Markus Wichmann
@ 2025-06-03 21:52   ` David Steele
  0 siblings, 0 replies; 2+ messages in thread
From: David Steele @ 2025-06-03 21:52 UTC (permalink / raw)
  To: Markus Wichmann, musl

On 6/3/25 11:03, Markus Wichmann wrote:
> Am Mon, Jun 02, 2025 at 07:33:41PM +0000 schrieb David Steele:
>> Ubuntu 22.04 (UTC) gcc:
>>
>> local epoch: 1573222014
>> utc epoch: 1573240014
>> local time: 20191108-090654
>> utc time: 20191108-140654
>>
>> [...]
>>
>> Alpine 3.21 (America/New_York or UTC) gcc/musl:
>>
>> local epoch: 1573222014
>> utc epoch: 1573222014        <------
>> local time: 20191108-090654
>> utc time: 20191108-140654
>>
> 
> I think what happened here is that musl is currently implementing
> non-standard extension behavior that is no longer conforming as of last
> year. My reading of POSIX-2024 is that strftime() is to treat the
> incoming timestamp as local time, at least for the purpose of a %s
> conversion.  Which it isn't at the moment. But POSIX-2018 did not
> specify %s at all, so musl was allowed to do whatever until POSIX-2024.

Interesting -- thanks for the analysis.

The only place this appears is in our unit tests so we can just remove 
it and add an assert to ensure we don't accidentally use it in core.

I did want to bring it up, though, just in case it needed to be fixed.

Thanks,
-David

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-03 22:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <70c350e5-78cd-4ab9-ae9b-598179ee4f8e@pgbackrest.org>
2025-06-03 15:03 ` [musl] Possible issue formatting epoch time with strftime() Markus Wichmann
2025-06-03 21:52   ` David Steele

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).