Hqkpf066133; Wed, 22 Oct 2025 17:52:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59MHqkbS066130; Wed, 22 Oct 2025 17:52:46 GMT (envelope-from git) Date: Wed, 22 Oct 2025 17:52:46 GMT Message-Id: <202510221752.59MHqkbS066130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 3b9b7e09e359 - stable/14 - libc: Add "Z" as TZ designator for strptime. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3b9b7e09e359ac20f83d4dd972271ff950b62da6 Auto-Submitted: auto-generated The branch stable/14 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=3b9b7e09e359ac20f83d4dd972271ff950b62da6 commit 3b9b7e09e359ac20f83d4dd972271ff950b62da6 Author: Gordon Tetlow AuthorDate: 2025-10-15 22:24:06 +0000 Commit: Gordon Tetlow CommitDate: 2025-10-22 17:52:36 +0000 libc: Add "Z" as TZ designator for strptime. ISO 8601 allows use of "Z" as the time zone designator. Update the strptime parser to allow this usage. While we are at it, update the manpage to reflect that both UTC and Z are now valid options. Reviewed by: des MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53083 (cherry picked from commit 79e57ea662d92ffcbe7d65854a284aefac6a332d) --- lib/libc/stdtime/strptime.3 | 2 +- lib/libc/stdtime/strptime.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libc/stdtime/strptime.3 b/lib/libc/stdtime/strptime.3 index 7df73d2d080a..9456fa757b85 100644 --- a/lib/libc/stdtime/strptime.3 +++ b/lib/libc/stdtime/strptime.3 @@ -171,7 +171,7 @@ is taken as noon. The .Fa %Z format specifier only accepts time zone abbreviations of the local time zone, -or the value "GMT". +and the values "GMT", "UTC", or "Z". This limitation is because of ambiguity due to of the over loading of time zone abbreviations. One such example is diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c index e9ffe7180916..b89e140aa8d5 100644 --- a/lib/libc/stdtime/strptime.c +++ b/lib/libc/stdtime/strptime.c @@ -554,7 +554,8 @@ label: zonestr[cp - buf] = '\0'; tzset(); if (0 == strcmp(zonestr, "GMT") || - 0 == strcmp(zonestr, "UTC")) { + 0 == strcmp(zonestr, "UTC") || + 0 == strcmp(zonestr, "Z")) { *GMTp = 1; } else if (0 == strcmp(zonestr, tzname[0])) { tm->tm_isdst = 0;