POSIX specifies that gmtime_r sets the tm_zone field to "UTC". (Interestingly, no such requirement exists for gmtime.) The comments in tests/test-gmtime_r.c remind us that this is not always the case.
2024-09-03 Bruno Haible <br...@clisp.org> doc: Mention a gmtime_r problem. * doc/posix-functions/gmtime_r.texi: Mention "UTC" vs. "GMT". diff --git a/doc/posix-functions/gmtime_r.texi b/doc/posix-functions/gmtime_r.texi index f49547595b..6474b9151a 100644 --- a/doc/posix-functions/gmtime_r.texi +++ b/doc/posix-functions/gmtime_r.texi @@ -23,4 +23,8 @@ On some platforms, this function yields incorrect values for timestamps before the year 1: MacOS X 10.5, Solaris 11.3. +@item +This function sets the field @code{tm_zone} to @code{"GMT"} +instead of @code{"UTC"} on some platforms: +glibc, NetBSD, OpenBSD, Minix, Cygwin, Android. @end itemize