Skip to content

Commit c1123be

Browse files
committed
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
1 parent b82eabe commit c1123be

File tree

1 file changed

+38
-8
lines changed

1 file changed

+38
-8
lines changed

doc/src/sgml/datatype.sgml

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,19 +1950,27 @@ MINUTE TO SECOND
19501950
</row>
19511951
<row>
19521952
<entry><literal>04:05:06.789-8</literal></entry>
1953-
<entry>ISO 8601</entry>
1953+
<entry>ISO 8601, with time zone as UTC offset</entry>
19541954
</row>
19551955
<row>
19561956
<entry><literal>04:05:06-08:00</literal></entry>
1957-
<entry>ISO 8601</entry>
1957+
<entry>ISO 8601, with time zone as UTC offset</entry>
19581958
</row>
19591959
<row>
19601960
<entry><literal>04:05-08:00</literal></entry>
1961-
<entry>ISO 8601</entry>
1961+
<entry>ISO 8601, with time zone as UTC offset</entry>
19621962
</row>
19631963
<row>
19641964
<entry><literal>040506-08</literal></entry>
1965-
<entry>ISO 8601</entry>
1965+
<entry>ISO 8601, with time zone as UTC offset</entry>
1966+
</row>
1967+
<row>
1968+
<entry><literal>040506+0730</literal></entry>
1969+
<entry>ISO 8601, with fractional-hour time zone as UTC offset</entry>
1970+
</row>
1971+
<row>
1972+
<entry><literal>040506+07:30:00</literal></entry>
1973+
<entry>UTC offset specified to seconds (not allowed in ISO 8601)</entry>
19661974
</row>
19671975
<row>
19681976
<entry><literal>04:05:06 PST</literal></entry>
@@ -1998,25 +2006,29 @@ MINUTE TO SECOND
19982006
<entry><literal>PST8PDT</literal></entry>
19992007
<entry>POSIX-style time zone specification</entry>
20002008
</row>
2009+
<row>
2010+
<entry><literal>-8:00:00</literal></entry>
2011+
<entry>UTC offset for PST</entry>
2012+
</row>
20012013
<row>
20022014
<entry><literal>-8:00</literal></entry>
2003-
<entry>ISO-8601 offset for PST</entry>
2015+
<entry>UTC offset for PST (ISO 8601 extended format)</entry>
20042016
</row>
20052017
<row>
20062018
<entry><literal>-800</literal></entry>
2007-
<entry>ISO-8601 offset for PST</entry>
2019+
<entry>UTC offset for PST (ISO 8601 basic format)</entry>
20082020
</row>
20092021
<row>
20102022
<entry><literal>-8</literal></entry>
2011-
<entry>ISO-8601 offset for PST</entry>
2023+
<entry>UTC offset for PST (ISO 8601 basic format)</entry>
20122024
</row>
20132025
<row>
20142026
<entry><literal>zulu</literal></entry>
20152027
<entry>Military abbreviation for UTC</entry>
20162028
</row>
20172029
<row>
20182030
<entry><literal>z</literal></entry>
2019-
<entry>Short form of <literal>zulu</literal></entry>
2031+
<entry>Short form of <literal>zulu</literal> (also in ISO 8601)</entry>
20202032
</row>
20212033
</tbody>
20222034
</tgroup>
@@ -2354,6 +2366,24 @@ January 8 04:05:06 1999 PST
23542366
</tgroup>
23552367
</table>
23562368

2369+
<para>
2370+
In the <acronym>ISO</acronym> style, the time zone is always shown as
2371+
a signed numeric offset from UTC, with positive sign used for zones
2372+
east of Greenwich. The offset will be shown
2373+
as <replaceable>hh</replaceable> (hours only) if it is an integral
2374+
number of hours, else
2375+
as <replaceable>hh</replaceable>:<replaceable>mm</replaceable> if it
2376+
is an integral number of minutes, else as
2377+
<replaceable>hh</replaceable>:<replaceable>mm</replaceable>:<replaceable>ss</replaceable>.
2378+
(The third case is not possible with any modern time zone standard,
2379+
but it can appear when working with timestamps that predate the
2380+
adoption of standardized time zones.)
2381+
In the other date styles, the time zone is shown as an alphabetic
2382+
abbreviation if one is in common use in the current zone. Otherwise
2383+
it appears as a signed numeric offset in ISO 8601 basic format
2384+
(<replaceable>hh</replaceable> or <replaceable>hhmm</replaceable>).
2385+
</para>
2386+
23572387
<para>
23582388
The date/time style can be selected by the user using the
23592389
<command>SET datestyle</command> command, the <xref

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy