Commit af2a0dfd authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Describe the date/time parsing rules.

Include specific information on the supported time zones.
 It's a really big table, so maybe it should go into an appendix instead.
parent 0c30f18f
...@@ -1255,19 +1255,24 @@ the time zone becomes GMT (on most systems anyway). ...@@ -1255,19 +1255,24 @@ the time zone becomes GMT (on most systems anyway).
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry>ACSST</entry> <entry>NZDT</entry>
<entry>+10:30 </entry> <entry>+13:00</entry>
<entry>Central Australia Summer Std Time</entry> <entry>New Zealand Daylight Time</entry>
</row> </row>
<row> <row>
<entry>ACST</entry> <entry>IDLE</entry>
<entry>+09:30 </entry> <entry>+12:00</entry>
<entry>Central Australia Std Time</entry> <entry>International Date Line, East</entry>
</row> </row>
<row> <row>
<entry>ADT</entry> <entry>NZST</entry>
<entry>-02:00 </entry> <entry>+12:00</entry>
<entry>Atlantic Daylight Time</entry> <entry>New Zealand Std Time</entry>
</row>
<row>
<entry>NZT</entry>
<entry>+12:00</entry>
<entry>New Zealand Time</entry>
</row> </row>
<row> <row>
<entry>AESST</entry> <entry>AESST</entry>
...@@ -1275,44 +1280,44 @@ the time zone becomes GMT (on most systems anyway). ...@@ -1275,44 +1280,44 @@ the time zone becomes GMT (on most systems anyway).
<entry>Australia Eastern Summer Std Time</entry> <entry>Australia Eastern Summer Std Time</entry>
</row> </row>
<row> <row>
<entry>AEST</entry> <entry>ACSST</entry>
<entry>+10:00 </entry> <entry>+10:30 </entry>
<entry>Australia Eastern Std Time</entry> <entry>Central Australia Summer Std Time</entry>
</row> </row>
<row> <row>
<entry>AHST</entry> <entry>CADT</entry>
<entry>-10:00 </entry> <entry>+10:30 </entry>
<entry>Alaska-Hawaii Std Time</entry> <entry>Central Australia Daylight Savings Time</entry>
</row> </row>
<row> <row>
<entry>AST</entry> <entry>SADT</entry>
<entry>-4:00 </entry> <entry>+10:30</entry>
<entry>Atlantic Std Time (Canada)</entry> <entry>South Australian Daylight Time</entry>
</row> </row>
<row> <row>
<entry>AWSST</entry> <entry>AEST</entry>
<entry>+9:00 </entry> <entry>+10:00 </entry>
<entry>Australia Western Summer Std Time</entry> <entry>Australia Eastern Std Time</entry>
</row> </row>
<row> <row>
<entry>AWST</entry> <entry>EAST</entry>
<entry>+8:00 </entry> <entry>+10:00 </entry>
<entry>Australia Western Std Time</entry> <entry>East Australian Std Time</entry>
</row> </row>
<row> <row>
<entry>BST</entry> <entry>GST</entry>
<entry>+1:00 </entry> <entry>+10:00</entry>
<entry>British Summer Time</entry> <entry>Guam Std Time, USSR Zone 9</entry>
</row> </row>
<row> <row>
<entry>BT</entry> <entry>LIGT</entry>
<entry>+3:00 </entry> <entry>+10:00</entry>
<entry>Baghdad Time</entry> <entry>Melbourne, Australia</entry>
</row> </row>
<row> <row>
<entry>CADT</entry> <entry>ACST</entry>
<entry>+10:30 </entry> <entry>+09:30 </entry>
<entry>Central Australia Daylight Savings Time</entry> <entry>Central Australia Std Time</entry>
</row> </row>
<row> <row>
<entry>CAST</entry> <entry>CAST</entry>
...@@ -1320,155 +1325,145 @@ the time zone becomes GMT (on most systems anyway). ...@@ -1320,155 +1325,145 @@ the time zone becomes GMT (on most systems anyway).
<entry>Central Australia Std Time</entry> <entry>Central Australia Std Time</entry>
</row> </row>
<row> <row>
<entry>CAT</entry> <entry>SAT</entry>
<entry>-10:00 </entry> <entry>+9:30</entry>
<entry>Central Alaska Time</entry> <entry>South Australian Std Time</entry>
</row>
<row>
<entry>CCT</entry>
<entry>+8:00 </entry>
<entry>China Coastal Time</entry>
</row> </row>
<row> <row>
<entry>CDT</entry> <entry>AWSST</entry>
<entry>-5:00 </entry> <entry>+9:00 </entry>
<entry>Central Daylight Time</entry> <entry>Australia Western Summer Std Time</entry>
</row> </row>
<row> <row>
<entry>CET</entry> <entry>JST</entry>
<entry>+1:00 </entry> <entry>+9:00</entry>
<entry>Central European Time</entry> <entry>Japan Std Time,USSR Zone 8</entry>
</row> </row>
<row> <row>
<entry>CETDST</entry> <entry>KST</entry>
<entry>+2:00 </entry> <entry>+9:00</entry>
<entry>Central European Daylight Savings Time</entry> <entry>Korea Standard Time</entry>
</row> </row>
<row> <row>
<entry>CST</entry> <entry>WDT</entry>
<entry>+6:00 </entry> <entry>+9:00</entry>
<entry>Central Std Time</entry> <entry>West Australian Daylight Time</entry>
</row> </row>
<row> <row>
<entry>DNT</entry> <entry>MT</entry>
<entry>+1:00 </entry> <entry>+8:30</entry>
<entry>Dansk Normal Tid</entry> <entry>Moluccas Time</entry>
</row> </row>
<row> <row>
<entry>DST</entry> <entry>AWST</entry>
<entry>+1:00 </entry> <entry>+8:00 </entry>
<entry>Dansk Standard Time (?)</entry> <entry>Australia Western Std Time</entry>
</row> </row>
<row> <row>
<entry>EAST</entry> <entry>CCT</entry>
<entry>+10:00 </entry> <entry>+8:00 </entry>
<entry>East Australian Std Time</entry> <entry>China Coastal Time</entry>
</row> </row>
<row> <row>
<entry>EDT</entry> <entry>WADT</entry>
<entry>-4:00 </entry> <entry>+8:00</entry>
<entry>Eastern Daylight Time</entry> <entry>West Australian Daylight Time</entry>
</row> </row>
<row> <row>
<entry>EET</entry> <entry>WST</entry>
<entry>+2:00 </entry> <entry>+8:00</entry>
<entry>Eastern Europe, USSR Zone 1</entry> <entry>West Australian Std Time</entry>
</row> </row>
<row> <row>
<entry>EETDST</entry> <entry>JT</entry>
<entry>+3:00 </entry> <entry>+7:30</entry>
<entry>Eastern Europe Daylight Savings Time</entry> <entry>Java Time</entry>
</row> </row>
<row> <row>
<entry>EST</entry> <entry>WAST</entry>
<entry>-5:00 </entry> <entry>+7:00</entry>
<entry>Eastern Standard Time</entry> <entry>West Australian Std Time</entry>
</row> </row>
<row> <row>
<entry>FST</entry> <entry>IT</entry>
<entry>+1:00 </entry> <entry>+3:30</entry>
<entry>French Summer Time</entry> <entry>Iran Time</entry>
</row> </row>
<row> <row>
<entry>FWT</entry> <entry>BT</entry>
<entry>+2:00</entry> <entry>+3:00 </entry>
<entry>French Winter Time</entry> <entry>Baghdad Time</entry>
</row> </row>
<row> <row>
<entry>GMT</entry> <entry>EETDST</entry>
<entry>0:00</entry> <entry>+3:00 </entry>
<entry>Greenwish Mean Time</entry> <entry>Eastern Europe Daylight Savings Time</entry>
</row> </row>
<row> <row>
<entry>GST</entry> <entry>CETDST</entry>
<entry>+10:00</entry> <entry>+2:00 </entry>
<entry>Guam Std Time, USSR Zone 9</entry> <entry>Central European Daylight Savings Time</entry>
</row> </row>
<row> <row>
<entry>HDT</entry> <entry>EET</entry>
<entry>-9:00</entry> <entry>+2:00 </entry>
<entry>Hawaii/Alaska</entry> <entry>Eastern Europe, USSR Zone 1</entry>
</row> </row>
<row> <row>
<entry>IDLE</entry> <entry>FWT</entry>
<entry>+12:00</entry> <entry>+2:00</entry>
<entry>International Date Line, East</entry> <entry>French Winter Time</entry>
</row> </row>
<row> <row>
<entry>IDLW</entry> <entry>IST</entry>
<entry>-12:00</entry> <entry>+2:00</entry>
<entry>International Date Line, West</entry> <entry>Israel Std Time</entry>
</row> </row>
<row> <row>
<entry>IST</entry> <entry>MEST</entry>
<entry>+2:00</entry> <entry>+2:00</entry>
<entry>Israel</entry> <entry>Middle Europe Summer Time</entry>
</row> </row>
<row> <row>
<entry>IT</entry> <entry>METDST</entry>
<entry>+3:40</entry> <entry>+2:00</entry>
<entry>Iran Time</entry> <entry>Middle Europe Daylight Time</entry>
</row> </row>
<row> <row>
<entry>JST</entry> <entry>SST</entry>
<entry>+9:00</entry> <entry>+2:00</entry>
<entry>Japan Std Time,USSR Zone 8</entry> <entry>Swedish Summer Time</entry>
</row> </row>
<row> <row>
<entry>JT</entry> <entry>BST</entry>
<entry>+7:30</entry> <entry>+1:00 </entry>
<entry>Java Time</entry> <entry>British Summer Time</entry>
</row> </row>
<row> <row>
<entry>KST</entry> <entry>CET</entry>
<entry>+9:00</entry> <entry>+1:00 </entry>
<entry>Korea Standard Time</entry> <entry>Central European Time</entry>
</row> </row>
<row> <row>
<entry>LIGT</entry> <entry>DNT</entry>
<entry>+10:00</entry> <entry>+1:00 </entry>
<entry>Melbourne, Australia</entry> <entry>Dansk Normal Tid</entry>
</row> </row>
<row> <row>
<entry>MDT</entry> <entry>DST</entry>
<entry>-6:00</entry> <entry>+1:00 </entry>
<entry>Mountain Daylight Time</entry> <entry>Dansk Standard Time (?)</entry>
</row> </row>
<row> <row>
<entry>MEST</entry> <entry>FST</entry>
<entry>+2:00</entry> <entry>+1:00 </entry>
<entry>Middle Europe Summer Time</entry> <entry>French Summer Time</entry>
</row> </row>
<row> <row>
<entry>MET</entry> <entry>MET</entry>
<entry>+1:00</entry> <entry>+1:00</entry>
<entry>Middle Europe Time</entry> <entry>Middle Europe Time</entry>
</row> </row>
<row>
<entry>METDST</entry>
<entry>+2:00</entry>
<entry>Middle Europe Daylight Time</entry>
</row>
<row> <row>
<entry>MEWT</entry> <entry>MEWT</entry>
<entry>+1:00</entry> <entry>+1:00</entry>
...@@ -1480,149 +1475,154 @@ the time zone becomes GMT (on most systems anyway). ...@@ -1480,149 +1475,154 @@ the time zone becomes GMT (on most systems anyway).
<entry>Middle Europe Zone</entry> <entry>Middle Europe Zone</entry>
</row> </row>
<row> <row>
<entry>MST</entry> <entry>NOR</entry>
<entry>-7:00</entry> <entry>+1:00</entry>
<entry>Mountain Standard Time</entry> <entry>Norway Standard Time</entry>
</row>
<row>
<entry>MT</entry>
<entry>+8:30</entry>
<entry>Moluccas Time</entry>
</row> </row>
<row> <row>
<entry>NDT</entry> <entry>SET</entry>
<entry>-2:30</entry> <entry>+1:00</entry>
<entry>Newfoundland Daylight Time</entry> <entry>Seychelles Time</entry>
</row> </row>
<row> <row>
<entry>NFT</entry> <entry>SWT</entry>
<entry>-3:30</entry> <entry>+1:00</entry>
<entry>Newfoundland Standard Time</entry> <entry>Swedish Winter Time</entry>
</row> </row>
<row> <row>
<entry>NOR</entry> <entry>WETDST</entry>
<entry>+1:00</entry> <entry>+1:00</entry>
<entry>Norway Standard Time</entry> <entry>Western Europe Daylight Savings Time</entry>
</row> </row>
<row> <row>
<entry>NST</entry> <entry>GMT</entry>
<entry>-3:30</entry> <entry>0:00</entry>
<entry>Newfoundland Standard Time</entry> <entry>Greenwish Mean Time</entry>
</row> </row>
<row> <row>
<entry>NT</entry> <entry>WET</entry>
<entry>-11:00</entry> <entry>0:00</entry>
<entry>Nome Time</entry> <entry>Western Europe</entry>
</row> </row>
<row> <row>
<entry>NZDT</entry> <entry>WAT</entry>
<entry>+13:00</entry> <entry>-1:00</entry>
<entry>New Zealand Daylight Time</entry> <entry>West Africa Time</entry>
</row> </row>
<row> <row>
<entry>NZST</entry> <entry>NDT</entry>
<entry>+12:00</entry> <entry>-2:30</entry>
<entry>New Zealand Std Time</entry> <entry>Newfoundland Daylight Time</entry>
</row> </row>
<row> <row>
<entry>NZT</entry> <entry>ADT</entry>
<entry>+12:00</entry> <entry>-03:00 </entry>
<entry>New Zealand Time</entry> <entry>Atlantic Daylight Time</entry>
</row> </row>
<row> <row>
<entry>PDT</entry> <entry>NFT</entry>
<entry>-7:00</entry> <entry>-3:30</entry>
<entry>Pacific Daylight Time</entry> <entry>Newfoundland Standard Time</entry>
</row> </row>
<row> <row>
<entry>PST</entry> <entry>NST</entry>
<entry>-8:00</entry> <entry>-3:30</entry>
<entry>Pacific Std Time</entry> <entry>Newfoundland Standard Time</entry>
</row> </row>
<row> <row>
<entry>SADT</entry> <entry>AST</entry>
<entry>+10:30</entry> <entry>-4:00 </entry>
<entry>South Australian Daylight Time</entry> <entry>Atlantic Std Time (Canada)</entry>
</row> </row>
<row> <row>
<entry>SAT</entry> <entry>EDT</entry>
<entry>+9:30</entry> <entry>-4:00 </entry>
<entry>South Australian Std Time</entry> <entry>Eastern Daylight Time</entry>
</row> </row>
<row> <row>
<entry>SET</entry> <entry>ZP4</entry>
<entry>+1:00</entry> <entry>-4:00</entry>
<entry>Seychelles Time</entry> <entry>GMT +4 hours</entry>
</row> </row>
<row> <row>
<entry>SST</entry> <entry>CDT</entry>
<entry>+2:00</entry> <entry>-5:00 </entry>
<entry>Swedish Summer Time</entry> <entry>Central Daylight Time</entry>
</row> </row>
<row> <row>
<entry>SWT</entry> <entry>EST</entry>
<entry>+1:00</entry> <entry>-5:00 </entry>
<entry>Swedish Winter Time</entry> <entry>Eastern Standard Time</entry>
</row> </row>
<row> <row>
<entry>WADT</entry> <entry>ZP5</entry>
<entry>+8:00</entry> <entry>-5:00</entry>
<entry>West Australian Daylight Time</entry> <entry>GMT +5 hours</entry>
</row> </row>
<row> <row>
<entry>WAST</entry> <entry>CST</entry>
<entry>+7:00</entry> <entry>-6:00 </entry>
<entry>West Australian Std Time</entry> <entry>Central Std Time</entry>
</row> </row>
<row> <row>
<entry>WAT</entry> <entry>MDT</entry>
<entry>-1:00</entry> <entry>-6:00</entry>
<entry>West Africa Time</entry> <entry>Mountain Daylight Time</entry>
</row> </row>
<row> <row>
<entry>WDT</entry> <entry>ZP6</entry>
<entry>+9:00</entry> <entry>-6:00</entry>
<entry>West Australian Daylight Time</entry> <entry>GMT +6 hours</entry>
</row> </row>
<row> <row>
<entry>WET</entry> <entry>MST</entry>
<entry>0:00</entry> <entry>-7:00</entry>
<entry>Western Europe</entry> <entry>Mountain Standard Time</entry>
</row> </row>
<row> <row>
<entry>WETDST</entry> <entry>PDT</entry>
<entry>+1:00</entry> <entry>-7:00</entry>
<entry>Western Europe Daylight Savings Time</entry> <entry>Pacific Daylight Time</entry>
</row> </row>
<row> <row>
<entry>WST</entry> <entry>PST</entry>
<entry>+8:00</entry> <entry>-8:00</entry>
<entry>West Australian Std Time</entry> <entry>Pacific Std Time</entry>
</row> </row>
<row> <row>
<entry>YDT</entry> <entry>YDT</entry>
<entry>-8:00</entry> <entry>-8:00</entry>
<entry>Yukon Daylight Time</entry> <entry>Yukon Daylight Time</entry>
</row> </row>
<row>
<entry>HDT</entry>
<entry>-9:00</entry>
<entry>Hawaii/Alaska Daylight Time</entry>
</row>
<row> <row>
<entry>YST</entry> <entry>YST</entry>
<entry>-9:00</entry> <entry>-9:00</entry>
<entry>Yukon Standard Time</entry> <entry>Yukon Standard Time</entry>
</row> </row>
<row> <row>
<entry>ZP4</entry> <entry>AHST</entry>
<entry>-4:00</entry> <entry>-10:00 </entry>
<entry>GMT +4 hours</entry> <entry>Alaska-Hawaii Std Time</entry>
</row> </row>
<row> <row>
<entry>ZP5</entry> <entry>CAT</entry>
<entry>-5:00</entry> <entry>-10:00 </entry>
<entry>GMT +5 hours</entry> <entry>Central Alaska Time</entry>
</row> </row>
<row> <row>
<entry>ZP6</entry> <entry>NT</entry>
<entry>-6:00</entry> <entry>-11:00</entry>
<entry>GMT +6 hours</entry> <entry>Nome Time</entry>
</row>
<row>
<entry>IDLW</entry>
<entry>-12:00</entry>
<entry>International Date Line, West</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
...@@ -1633,17 +1633,21 @@ the time zone becomes GMT (on most systems anyway). ...@@ -1633,17 +1633,21 @@ the time zone becomes GMT (on most systems anyway).
then <literal>EST</literal> refers to Australia Eastern Std Time, then <literal>EST</literal> refers to Australia Eastern Std Time,
which has an offset of +10:00 hours from UTC. which has an offset of +10:00 hours from UTC.
</para> </para>
</note>
<para> <para>
It is interesting that Australian time zones and their naming variants Australian time zones and their naming variants
account for fully one quarter of all time zones in the account for fully one quarter of all time zones in the
<productname>Postgres</productname> time zone lookup table. <productname>Postgres</productname> time zone lookup table.
</para> </para>
</note>
</para>
<procedure> <procedure>
<title>Date/Time Input Interpretation</title> <title>Date/Time Input Interpretation</title>
<para>
The date/time types are all decoded using a common set of routines.
</para>
<step> <step>
<para> <para>
Break the input string into tokens and categorize each token as Break the input string into tokens and categorize each token as
...@@ -1717,48 +1721,89 @@ the time zone becomes GMT (on most systems anyway). ...@@ -1717,48 +1721,89 @@ the time zone becomes GMT (on most systems anyway).
<step> <step>
<para> <para>
The token is a number or number field. If there are more than 4 digits, The token is a number or number field.
If there are more than 4 digits,
and if no other date fields have been previously read, then interpret and if no other date fields have been previously read, then interpret
as a "concatenated date". as a "concatenated date" (e.g. <literal>19990118</literal>).
</para> </para>
<substeps> <substeps>
<step> <step>
<para>If there </para> <para>
If there are more than 4 digits,
and if no other date fields have been previously read, then interpret
as a "concatenated date" (e.g. <literal>19990118</literal>).
</para>
</step>
<step>
<para>
If three digits and a year has already been decoded, then interpret as day of year.
</para>
</step> </step>
</substeps>
<step>
<para>
If longer than two digits, then interpret as a year.
</para>
</step> </step>
<step> <step>
<para> <para>
If in European date mode, and if the day field has not yet been read,
and if the value is less than or equal to 31, then interpret as a day.
</para> </para>
</step> </step>
<step> <step>
<para> <para>
If in non-European (US) date mode, and if the month field has not yet been read,
and if the value is less than or equal to 12, then interpret as a month.
</para> </para>
</step> </step>
<step> <step>
<para> <para>
If the day field has not yet been read,
and if the value is less than or equal to 31, then interpret as a month.
</para> </para>
</step> </step>
<step> <step>
<para> <para>
If the month field has not yet been read,
and if the value is less than or equal to 12, then interpret as a month.
</para> </para>
</step> </step>
<step> <step>
<para> <para>
Otherwise, interpret as a year.
</para>
</step>
</substeps>
</step>
<step>
<para>
If BC has been specified, negate the year and offset by one
(there is no year zero in the Gregorian calendar).
</para>
</step>
<step>
<para>
If BC was not specified, and if the year field was two digits in length, then
adjust the year to 4 digits. If the field was less than 70, then add 2000;
otherwise, add 1900.
</para> </para>
</step> </step>
</procedure> </procedure>
</sect2> </sect2>
<sect2> <sect2>
<title>datetime</title> <title>datetime</title>
<para> <para>
General-use date and time is input using a wide range of General-use date and time is input using a wide range of
...@@ -2377,7 +2422,7 @@ the bits part. ...@@ -2377,7 +2422,7 @@ the bits part.
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
sgml-omittag:t sgml-omittag:nil
sgml-shorttag:t sgml-shorttag:t
sgml-minimize-attributes:nil sgml-minimize-attributes:nil
sgml-always-quote-attributes:t sgml-always-quote-attributes:t
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment