NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/57588: gmtime(3): value of %s depends on TZ environment variable



>Number:         57588
>Category:       lib
>Synopsis:       gmtime(3): value of %s depends on TZ environment variable
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 19 08:50:00 +0000 2023
>Originator:     Roland Illig
>Release:        10.99.3
>Organization:
>Environment:
NetBSD nbcurr.roland-illig.de 10.99.3 NetBSD 10.99.3 (GENERIC) #0: Fri Apr 21 02:17:32 UTC 2023  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
As documented in usr.bin/make/unit-tests/varmod-gmtime.mk 1.16 line 149, calling gmtime followed by strftime("%s") depends on the timezone, even though the timezone should not affect gmtime.

This bug does not affect date(1), as that utility always uses localtime(3) (for undocumented reasons) and rather sets the TZ environment variable instead of using gmtime(3).
>How-To-Repeat:
TZ=Europe/Berlin make -r -f /dev/null -v '${%s:L:gmtime}'
TZ=Europe/Berlin date -u +%s

These two commands should output the same value, but they don't.
>Fix:



Home | Main Index | Thread Index | Old Index