Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wKPBf-000w4c-1o for pgsql-docs@arkaria.postgresql.org; Tue, 05 May 2026 23:28:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wKPBe-00ENIU-1G for pgsql-docs@arkaria.postgresql.org; Tue, 05 May 2026 23:28:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wKPBe-00ENIM-0R for pgsql-docs@lists.postgresql.org; Tue, 05 May 2026 23:28:22 +0000 Received: from mail-yx1-xb12e.google.com ([2607:f8b0:4864:20::b12e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wKPBb-00000000jPz-3ubA for pgsql-docs@lists.postgresql.org; Tue, 05 May 2026 23:28:21 +0000 Received: by mail-yx1-xb12e.google.com with SMTP id 956f58d0204a3-65c7a459105so363224d50.0 for ; Tue, 05 May 2026 16:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1778023698; cv=none; d=google.com; s=arc-20240605; b=hxrLItuIsj1ZmeQ9/oPQZW7Evb+C7uRQFiF4N+fnvSNWjj1J/dpwNYJxogaMdP9tRl y8nvsdWpteh+IKRjwpLubVnYEkAv+Xmrc4WGaGaZ+TDD+rFs/Z2KjEPlGfLSGLFAacZU 9V32/adTWVI1shtwUGF8/ZnLQ5x9HXWn2JjPpuYY4r6e3ugUqi/u/27dwkhwJWIc1Ir1 IQZG98F0j1H+knIgdoGu4AK2hdqiua/b5ldLRK6Ixt0m8fvTWeuLm+OKTnpdhrE7Y/Hw WGPXwn+13KZWAlX/t+9Bi95Y38yhjl6VV3126OvETcvv+wYRs9iYQ9v0gg2bV6QO+rML BPMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=tc2G9Lb/n882RWI66P4zrcytpcbDc49vKqL+6ofjdK4=; fh=JlhsJhHwJBFRe5gvQ5QnUp/meXeD27qf6x3PhmI5wzE=; b=d8FiBy93iyYrMmxX0T87koHHH1R6ZUdvXFyJBDYtok5wmJNydcVA8E4NFQIGsZ0VUm R1CVBYPm1DG08AQa9D2s5AGBljTIirmEtp+Os4g4yJf8/80E+wh16PkYfYColkcNwhvh LvBgnn8gB3LO5FbXUvp6uwcQnRrVkq1HCdMie+kFKpoEyiTkztTwlG1lt5eVii3vTdRJ Q6/2mSDTDdai8uc7/OXlddhP12ScYpK/zppA4D5WP5RY1u87T4Y9TXj4Fc6XdjpDkBnf s7T6CY38/3MZwk5iRFnhp63DpD85b+y1ydSgtFSFrXaNFU79WTuaVFRII5knHSUJTmBn pgQg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778023698; x=1778628498; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=tc2G9Lb/n882RWI66P4zrcytpcbDc49vKqL+6ofjdK4=; b=NMG5fRDc1RkJM6V9TCUSFI+hruTNJxVsIiA4OTDy55VM+2yVONnpPHHowzJ/shlI0z 0joSd5I4NQ8P6eXkNsCVFAAf4hUPKE3zKWRz7vzqxpTYwiD5wwIjKMTQAH+6ZkVw617K uaD2mCXq1wcH9mlRmBJol0NPlHtSYh8MX4lsDVzsBuFwOYkjtGnRWxVPnFL9s761iXCC Hr5n2e63E6CAOwaNI1Bhxtizzr7JUebFsv2Kii2Z9XJYn736AvztLTGlnaV4BfVyU+6o apLhiVPNBndhvDSye95fv3IV9dAAXxG3tVOzII8mmj6zl19XEo4BMr0Nu+lT1BP/S0DV AVng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778023698; x=1778628498; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tc2G9Lb/n882RWI66P4zrcytpcbDc49vKqL+6ofjdK4=; b=bfYsxrJhxYXKt9J7sWyuBJ7kaML09wFvfp1gVLV3ofvYE32DDK3USxSJ+AZnu4p8E7 dQXC8eI/AP258kBvhY06UQwS/HVNRjDvTHRvE8y62btxyOKz7oIbC5uwn6WZpfHxsiUs e1Q+pqee26F9tLKXMXK/kWEsNzi+nGbkKRh88DLosglr7ZOILZvYNMYRE2oPnkXfB3DN PzDJJTd0MyeyiNotAJDIcuv9GtwM7vYuwdOwEC5ncqqO0UVUSouexROa6G5EsDg3+7G7 4P5IzerReS4+Rt11wSeI2fDFsCITl3o6D86daWU5Attckk8A7XZj3YgLKR4e8m1LgXwo kACQ== X-Forwarded-Encrypted: i=1; AFNElJ+APYAOHBCWQEI4Tu1BNoVsLfwzR0YmPXbdE/4erhLg7tp9pG03awOZRAGV+Xf/BR1+hRmMEgr84ipq@lists.postgresql.org X-Gm-Message-State: AOJu0YwkfM9T0ixJfvl0tGiOgoIF9UoFrVHBTQxRVj8meC2bgekDbuGt foaXX8nnf+Y6HIrS83hxY0pB2LIw8CcZ4mx8J8yVpoL7vKIr8OyWkveDYZybUlpJ+f1jcyVRk9M 0/9LRpippRSzD/RVR9iiYQdpnZdA40x0= X-Gm-Gg: AeBDietiID0A+IEucdVZTDZhbzE5Z2Mug12rklWRfx59RdGEe9k+xWJfNjGmKUvrH/D rbQn12kz3rv+UMnkGfcxhXLhlQiuCcTOjAaOgjQ/ixec+UVjrZJ6jQFu4QrBunvTqXtJlOjjcn7 hUt1vkzcIfAf49OE/zJCBrSSsY1wVtw1tgZtinAlhvHsbAsHmvbZ69Zrfe0k/ALXo+Q+pGozWSU S3BZY0sdkofG1++CjkbHSBCxYzl1fhMQFyVhjAO/4ueRIhxMBzrcwPhWMuPw3QjknEMfiY7bdHR AzbJoBs1aT57Mt6+qw== X-Received: by 2002:a05:690e:1c1a:b0:650:26c1:ee84 with SMTP id 956f58d0204a3-65c67f4f51bmr5309196d50.11.1778023698219; Tue, 05 May 2026 16:28:18 -0700 (PDT) MIME-Version: 1.0 References: <177801333530.795.16999885814007014333@wrigleys.postgresql.org> In-Reply-To: <177801333530.795.16999885814007014333@wrigleys.postgresql.org> From: "David G. Johnston" Date: Tue, 5 May 2026 16:27:42 -0700 X-Gm-Features: AVHnY4LRn82Jqm9ZJq6nv80ugxDv3dOXporM0oBg8r8aBVoQV_k5k_5Ctwu1mOs Message-ID: Subject: Re: Suspected documentation error To: scoobster17@gmail.com, pgsql-docs@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000ef448c06511a6673" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ef448c06511a6673 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 5, 2026 at 3:02=E2=80=AFPM PG Doc comments form wrote: > As such, whilst looking through this page > (https://www.postgresql.org/docs/current/functions-formatting.html) as > shown > in the Udemy course I'm following, I noticed that the notes "OF" state > "time-zone offset from UTC (HH or HH:MM)", which I believe should be > "time-zone offset from UTC (HH or HH:MI)". > > Technically interpreting either of those according to the format specifiers co-located in that table is wrong. All HH and MM stand for here are hours and minutes, trying to communicate fixed two-digits. psql -c "SET LOCAL timezone =3D 'Pacific/Apia'; SELECT to_char(now(), 'YYYY-MM-DD HH24:MI:SS OF') AS plus13_apia;" plus13_apia ------------------------- 2026-05-06 12:11:49 +13 (1 row) HH is defined on the range 0-12 but here we see we get +13 (and it's easy to also produce negative offsets). That said, the way I'd fix this is: TZH - time-zone hours offset from UTC , signed, two-digits, e.g., -04 or +0= 5 TZM - time-zone minutes offset from UTC, unsigned two-digit (to append, not add), e.g., 00 or 30 OF - TZH[:TZM] time-zone offset, but minutes are suppressed when zero. e.g., -04 or +05:30 David J. --000000000000ef448c06511a6673 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, May 5, 2026 at 3:02=E2=80=AFPM PG Doc comments for= m <noreply@postgresql.org&= gt; wrote:
As such, whilst lookin= g through this page
(https://www.postgresql.org/docs/cu= rrent/functions-formatting.html) as shown
in the Udemy course I'm following, I noticed that the notes "OF&qu= ot; state
"time-zone offset from UTC (HH or HH:MM)", which I believe should= be
"time-zone offset from UTC (HH or HH:MI)".


Technically interpreting either of those according to the f= ormat specifiers co-located in that table is wrong.=C2=A0 All HH and MM sta= nd for here are hours and minutes,=C2=A0trying to communicate fixed two-dig= its.

psql -c "SET LOCAL timezone =3D 'Pacific= /Apia'; SELECT to_char(now(), 'YYYY-MM-DD HH24:MI:SS OF') AS pl= us13_apia;"

=C2=A0 =C2=A0 =C2=A0 =C2=A0plus13_api= a =C2=A0 =C2=A0 =C2=A0
-------------------------
=C2=A02026-05-06 12= :11:49 +13
(1 row)

HH is defined on the range 0-12 but here we se= e we get=C2=A0+13 (and it's easy to also produce negative offsets).

That said, the way I'd fix this is:

TZH - time-zone hours offset from UTC , signed, two-digits, e.g., -04= or +05
TZM - time-zone minutes offset from UTC, unsigned two-digit= (to append, not add), e.g., 00 or 30
OF - TZH[:TZM] time-zone offs= et, but minutes are suppressed when zero. e.g., -04 or +05:30

<= /div>
David J.

--000000000000ef448c06511a6673--