From nobody Wed Oct 15 22:24:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cn5Gz2vz4z6D5HP; Wed, 15 Oct 2025 22:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cn5Gz21GLz3SRW; Wed, 15 Oct 2025 22:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760567067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d+Dnup4J62ygdnCwHs1vHuXb+ZsRUqZSzcsOpBY6o4M=; b=pWCdvA/Wc3mA0sxZb5ktAqlIandSbk5+FD9odffpYk5lkqzSvRqOG/tfgeFd/jVzJGq/fS snlD8t3bzplPt/PqtPN3ZLYfskaX003TpXBWQWkmE79ccgXVYpkijgPLEx5gW6xhyk2pVV lcHtvIKDOg6Ga4ZZn+bsFMiDdQVZEXvF1S//zqOzvAI3WPCUYshX01SBZHmpDOJxQn7mp2 nqhG4ObOUXoJC3gvr020VE9FOt8EEOw5d6NfNhAgAb9ix0tdZGyrKyII4TD+HeWL0yVDer bYVjwbfCbtwH71ftSHBQupD+yDIraf+pRl7BsPFAAwu8InZnh0B+Hyl3JuKetw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760567067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d+Dnup4J62ygdnCwHs1vHuXb+ZsRUqZSzcsOpBY6o4M=; b=yr45gNMj0HcVzxi+/DzoCZL76nFadfESfhF09f5xPrw9wMd6GdfpirGbN/lD2vFVsWmr8x 67rhzD2SbVEiyQPiUakcb7Nh6093JrYdwNxGai59M2bppAtjQjT95CBRc0OPzoFxE8PrEg U/425i9rUiU8VxH3QYI/W1+oBgfhdCNXXI6KrERBmEauFE4J4JGHR5SCoiHop+EkYwyRMn +s/jTieZOdrC0sDdtkUPMQz7ka0vHuLAblLcWc5nhgkMXo/ueLafdKDTIIdvkMoqRFJ5cE crF3G0MMc9mOMzE+FgXO4V8ZWHaWiYG1jWTFzJlNsOASbwZb7hWK+Ev0y+OghQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760567067; a=rsa-sha256; cv=none; b=xP1l9HDu1+EWloD/cYJBLA/5UJg90UHFh3gnrHR0b8h07HuFkdmMvBIvOFMmLi1gUPfI+e EVXO9q3PwrWY33h8n5Ras62HDg3+gGTmuDqUhcQIQ+uXA/bM1GWV9Z2rm7nHg62rR2Odog 3OBjJAURxyuCMAs0mxEHH/bCEzYP9M8sC6Wqxpon6PqBdQlb0434iPaC2gZ18+abKX0O1Z D31o7adxGtHnLUVADtDb7PuS4LRJh+mqvjMqHRpy90nKpjLeU1kpKDR3AMPdkoM7YslVI1 AnqJ/KKTncLO36CKPCvfeKgNGc0/lO2+oST4m5r5BgHI3foCKiggnlltCFGp7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cn5Gz1Q8czxf2; Wed, 15 Oct 2025 22:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59FMORaE068280; Wed, 15 Oct 2025 22:24:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59FMORtf068277; Wed, 15 Oct 2025 22:24:27 GMT (envelope-from git) Date: Wed, 15 Oct 2025 22:24:27 GMT Message-Id: <202510152224.59FMORtf068277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Tetlow Subject: git: 79e57ea662d9 - main - libc: Add "Z" as TZ designator for strptime. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 79e57ea662d92ffcbe7d65854a284aefac6a332d Auto-Submitted: auto-generated The branch main has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=79e57ea662d92ffcbe7d65854a284aefac6a332d commit 79e57ea662d92ffcbe7d65854a284aefac6a332d Author: Gordon Tetlow AuthorDate: 2025-10-15 22:24:06 +0000 Commit: Gordon Tetlow CommitDate: 2025-10-15 22:24:07 +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 --- 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 5f1293c7a267..375e49146639 100644 --- a/lib/libc/stdtime/strptime.c +++ b/lib/libc/stdtime/strptime.c @@ -546,7 +546,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;