[tz] Weird PST8PDT and EST5EDT behavior on Alpine Linux
Đoàn Trần Công Danh
congdanhqx at gmail.com
Tue Mar 5 03:52:23 UTC 2024
On 2024-03-03 22:51:49-0800, Russ Allbery via tz <tz at iana.org> wrote:
> Why would the system decide that time stamp should use daylight saving
> time? The system time zone is set to UTC, so it shouldn't be some sort of
> contamination from it. Or is this some odd bug in the busybox date
> command? It works correctly with busybox 1.36.1 on a Debian system,
> though:
>
> % busybox env TZ=PST8PDT date -R -d @1643145780
> Tue, 25 Jan 2022 13:23:00 -0800
>
> The Alpine Linux system in question does have PST8PDT and EST5EDT files in
> /usr/share/zoneinfo. The Olson time zone identifiers do work as expected:
Please correct me if I were wrong!
(also added musl-lib list)
I believe it's musl-libc's behaviours.
Both PST8PDT and EST5EDT are timezones in POSIX form.
musl specificly check for that first [1].
Time POSIX form is (space inserted for clarity):
std offset[dst[offset][,start[/time],end[/time]]]
But seems like nothings was enforced if rule isnot given in the
timezone, which makes it open to intepretion.
Musl inteprete that as no transition at all [2].
1: https://git.musl-libc.org/cgit/musl/tree/src/time/__tz.c?h=v1.2.5&id=0784374d561435f7c787a555aeab8ede699ed298#n159
2: https://git.musl-libc.org/cgit/musl/tree/src/time/__tz.c?h=v1.2.5&id=0784374d561435f7c787a555aeab8ede699ed298#n240
--
Danh
More information about the tz
mailing list