From fa44348105983fb8a20a1eb145ca036e77807ba0 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 6 Jul 2021 10:34:51 -0400 Subject: [PATCH] Doc: add info about timestamps with fractional-minute UTC offsets. Our code has supported fractional-minute UTC offsets for ages, but there was no mention of the possibility in the main docs, and only a very indirect reference in Appendix B. Improve that. Discussion: https://postgr.es/m/162543102827.697.5755498651217979813@wrigleys.postgresql.org --- doc/src/sgml/datatype.sgml | 46 +++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 483263997f..4512e80368 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1977,19 +1977,27 @@ MINUTE TO SECOND 04:05:06.789-8 - ISO 8601 + ISO 8601, with time zone as UTC offset 04:05:06-08:00 - ISO 8601 + ISO 8601, with time zone as UTC offset 04:05-08:00 - ISO 8601 + ISO 8601, with time zone as UTC offset 040506-08 - ISO 8601 + ISO 8601, with time zone as UTC offset + + + 040506+0730 + ISO 8601, with fractional-hour time zone as UTC offset + + + 040506+07:30:00 + UTC offset specified to seconds (not allowed in ISO 8601) 04:05:06 PST @@ -2025,17 +2033,21 @@ MINUTE TO SECOND PST8PDT POSIX-style time zone specification + + -8:00:00 + UTC offset for PST + -8:00 - ISO-8601 offset for PST + UTC offset for PST (ISO 8601 extended format) -800 - ISO-8601 offset for PST + UTC offset for PST (ISO 8601 basic format) -8 - ISO-8601 offset for PST + UTC offset for PST (ISO 8601 basic format) zulu @@ -2043,7 +2055,7 @@ MINUTE TO SECOND z - Short form of zulu + Short form of zulu (also in ISO 8601) @@ -2393,6 +2405,24 @@ TIMESTAMP WITH TIME ZONE '2004-10-19 10:23:54+02' + + In the ISO style, the time zone is always shown as + a signed numeric offset from UTC, with positive sign used for zones + east of Greenwich. The offset will be shown + as hh (hours only) if it is an integral + number of hours, else + as hh:mm if it + is an integral number of minutes, else as + hh:mm:ss. + (The third case is not possible with any modern time zone standard, + but it can appear when working with timestamps that predate the + adoption of standardized time zones.) + In the other date styles, the time zone is shown as an alphabetic + abbreviation if one is in common use in the current zone. Otherwise + it appears as a signed numeric offset in ISO 8601 basic format + (hh or hhmm). + + The date/time style can be selected by the user using the SET datestyle command, the