| From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
|---|---|
| To: | scoobster17(at)gmail(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Suspected documentation error |
| Date: | 2026-05-05 23:27:42 |
| Message-ID: | CAKFQuwYWhSxoCPf9RTVVgs96oU78rdh3Aj05s2PCppb1GscA8g@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-docs |
On Tue, May 5, 2026 at 3:02 PM PG Doc comments form <noreply(at)postgresql(dot)org>
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 = '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 +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 offset, but minutes are suppressed when zero.
e.g., -04 or +05:30
David J.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2026-05-06 13:52:02 | Re: Suspected documentation error |
| Previous Message | surya poondla | 2026-05-05 23:26:32 | Re: doc: Clarify ANALYZE VERBOSE output |