1999-05-22 04:27:25 +02:00
|
|
|
|
<!--
|
2001-09-28 10:15:35 +02:00
|
|
|
|
$Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.22 2001/09/28 08:15:35 thomas Exp $
|
1999-05-22 04:27:25 +02:00
|
|
|
|
Date/time details
|
|
|
|
|
-->
|
1999-05-20 07:39:29 +02:00
|
|
|
|
|
2001-01-06 12:58:56 +01:00
|
|
|
|
<appendix id="datetime-appendix">
|
1999-05-26 19:30:30 +02:00
|
|
|
|
<title id="datetime-appendix-title">Date/Time Support</title>
|
1999-05-20 07:39:29 +02:00
|
|
|
|
|
2000-09-29 22:21:34 +02:00
|
|
|
|
<sect1 id="timezones">
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<title>Time Zones</title>
|
1999-05-20 07:39:29 +02:00
|
|
|
|
|
2001-05-13 00:51:36 +02:00
|
|
|
|
<indexterm zone="timezones">
|
|
|
|
|
<primary>time zones</primary>
|
|
|
|
|
</indexterm>
|
|
|
|
|
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<para>
|
2001-09-28 10:15:35 +02:00
|
|
|
|
<productname>Postgres</productname> contains internal tabular
|
1999-06-23 08:17:51 +02:00
|
|
|
|
information for time zone decoding, since there is no *nix standard
|
|
|
|
|
system interface to provide access to general, cross-timezone
|
|
|
|
|
information. The underlying OS <emphasis>is</emphasis> used to
|
2001-06-18 21:05:11 +02:00
|
|
|
|
provide time zone information for <emphasis>output</emphasis>, however.
|
1999-06-23 08:17:51 +02:00
|
|
|
|
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<table tocentry="1">
|
|
|
|
|
<title><productname>Postgres</productname> Recognized Time Zones</title>
|
|
|
|
|
<titleabbrev>Time Zones</titleabbrev>
|
|
|
|
|
<tgroup cols="3">
|
|
|
|
|
<thead>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>Time Zone</entry>
|
|
|
|
|
<entry>Offset from UTC</entry>
|
|
|
|
|
<entry>Description</entry>
|
|
|
|
|
</row>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>NZDT</entry>
|
|
|
|
|
<entry>+13:00</entry>
|
|
|
|
|
<entry>New Zealand Daylight Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>IDLE</entry>
|
|
|
|
|
<entry>+12:00</entry>
|
|
|
|
|
<entry>International Date Line, East</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>NZST</entry>
|
|
|
|
|
<entry>+12:00</entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>New Zealand Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>NZT</entry>
|
|
|
|
|
<entry>+12:00</entry>
|
|
|
|
|
<entry>New Zealand Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>AESST</entry>
|
|
|
|
|
<entry>+11:00 </entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Australia Eastern Summer Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>ACSST</entry>
|
|
|
|
|
<entry>+10:30 </entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Central Australia Summer Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>CADT</entry>
|
|
|
|
|
<entry>+10:30 </entry>
|
|
|
|
|
<entry>Central Australia Daylight Savings Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>SADT</entry>
|
|
|
|
|
<entry>+10:30</entry>
|
|
|
|
|
<entry>South Australian Daylight Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>AEST</entry>
|
|
|
|
|
<entry>+10:00 </entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Australia Eastern Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>EAST</entry>
|
|
|
|
|
<entry>+10:00 </entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>East Australian Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>GST</entry>
|
|
|
|
|
<entry>+10:00</entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Guam Standard Time, USSR Zone 9</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>LIGT</entry>
|
|
|
|
|
<entry>+10:00</entry>
|
|
|
|
|
<entry>Melbourne, Australia</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>ACST</entry>
|
|
|
|
|
<entry>+09:30 </entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Central Australia Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
2000-10-20 15:57:10 +02:00
|
|
|
|
<entry>SAST</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<entry>+09:30 </entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>South Australia Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
2000-10-20 15:57:10 +02:00
|
|
|
|
<entry>CAST</entry>
|
|
|
|
|
<entry>+09:30 </entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Central Australia Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>AWSST</entry>
|
|
|
|
|
<entry>+9:00 </entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Australia Western Summer Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>JST</entry>
|
|
|
|
|
<entry>+9:00</entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Japan Standard Time,USSR Zone 8</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>KST</entry>
|
|
|
|
|
<entry>+9:00</entry>
|
|
|
|
|
<entry>Korea Standard Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>WDT</entry>
|
|
|
|
|
<entry>+9:00</entry>
|
|
|
|
|
<entry>West Australian Daylight Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>MT</entry>
|
|
|
|
|
<entry>+8:30</entry>
|
|
|
|
|
<entry>Moluccas Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>AWST</entry>
|
|
|
|
|
<entry>+8:00 </entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Australia Western Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>CCT</entry>
|
|
|
|
|
<entry>+8:00 </entry>
|
|
|
|
|
<entry>China Coastal Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>WADT</entry>
|
|
|
|
|
<entry>+8:00</entry>
|
|
|
|
|
<entry>West Australian Daylight Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>WST</entry>
|
|
|
|
|
<entry>+8:00</entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>West Australian Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>JT</entry>
|
|
|
|
|
<entry>+7:30</entry>
|
|
|
|
|
<entry>Java Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>WAST</entry>
|
|
|
|
|
<entry>+7:00</entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>West Australian Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>IT</entry>
|
|
|
|
|
<entry>+3:30</entry>
|
|
|
|
|
<entry>Iran Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>BT</entry>
|
|
|
|
|
<entry>+3:00 </entry>
|
|
|
|
|
<entry>Baghdad Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>EETDST</entry>
|
|
|
|
|
<entry>+3:00 </entry>
|
|
|
|
|
<entry>Eastern Europe Daylight Savings Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>CETDST</entry>
|
|
|
|
|
<entry>+2:00 </entry>
|
|
|
|
|
<entry>Central European Daylight Savings Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>EET</entry>
|
|
|
|
|
<entry>+2:00 </entry>
|
|
|
|
|
<entry>Eastern Europe, USSR Zone 1</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>FWT</entry>
|
|
|
|
|
<entry>+2:00</entry>
|
|
|
|
|
<entry>French Winter Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>IST</entry>
|
|
|
|
|
<entry>+2:00</entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Israel Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>MEST</entry>
|
|
|
|
|
<entry>+2:00</entry>
|
|
|
|
|
<entry>Middle Europe Summer Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>METDST</entry>
|
|
|
|
|
<entry>+2:00</entry>
|
|
|
|
|
<entry>Middle Europe Daylight Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>SST</entry>
|
|
|
|
|
<entry>+2:00</entry>
|
|
|
|
|
<entry>Swedish Summer Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>BST</entry>
|
|
|
|
|
<entry>+1:00 </entry>
|
|
|
|
|
<entry>British Summer Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>CET</entry>
|
|
|
|
|
<entry>+1:00 </entry>
|
|
|
|
|
<entry>Central European Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>DNT</entry>
|
|
|
|
|
<entry>+1:00 </entry>
|
2001-09-09 19:21:59 +02:00
|
|
|
|
<entry><foreignphrase>Dansk Normal Tid</foreignphrase></entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>FST</entry>
|
|
|
|
|
<entry>+1:00 </entry>
|
|
|
|
|
<entry>French Summer Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>MET</entry>
|
|
|
|
|
<entry>+1:00</entry>
|
|
|
|
|
<entry>Middle Europe Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>MEWT</entry>
|
|
|
|
|
<entry>+1:00</entry>
|
|
|
|
|
<entry>Middle Europe Winter Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>MEZ</entry>
|
|
|
|
|
<entry>+1:00</entry>
|
|
|
|
|
<entry>Middle Europe Zone</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>NOR</entry>
|
|
|
|
|
<entry>+1:00</entry>
|
|
|
|
|
<entry>Norway Standard Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>SET</entry>
|
|
|
|
|
<entry>+1:00</entry>
|
|
|
|
|
<entry>Seychelles Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>SWT</entry>
|
|
|
|
|
<entry>+1:00</entry>
|
|
|
|
|
<entry>Swedish Winter Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>WETDST</entry>
|
|
|
|
|
<entry>+1:00</entry>
|
|
|
|
|
<entry>Western Europe Daylight Savings Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>GMT</entry>
|
|
|
|
|
<entry>0:00</entry>
|
2001-02-12 15:21:27 +01:00
|
|
|
|
<entry>Greenwich Mean Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>WET</entry>
|
|
|
|
|
<entry>0:00</entry>
|
|
|
|
|
<entry>Western Europe</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>WAT</entry>
|
|
|
|
|
<entry>-1:00</entry>
|
|
|
|
|
<entry>West Africa Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>NDT</entry>
|
|
|
|
|
<entry>-2:30</entry>
|
|
|
|
|
<entry>Newfoundland Daylight Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>ADT</entry>
|
|
|
|
|
<entry>-03:00 </entry>
|
|
|
|
|
<entry>Atlantic Daylight Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>NFT</entry>
|
|
|
|
|
<entry>-3:30</entry>
|
|
|
|
|
<entry>Newfoundland Standard Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>NST</entry>
|
|
|
|
|
<entry>-3:30</entry>
|
|
|
|
|
<entry>Newfoundland Standard Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>AST</entry>
|
|
|
|
|
<entry>-4:00 </entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Atlantic Standard Time (Canada)</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>EDT</entry>
|
|
|
|
|
<entry>-4:00 </entry>
|
|
|
|
|
<entry>Eastern Daylight Time</entry>
|
|
|
|
|
</row>
|
2000-10-20 15:57:10 +02:00
|
|
|
|
<!--
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<row>
|
|
|
|
|
<entry>ZP4</entry>
|
|
|
|
|
<entry>-4:00</entry>
|
|
|
|
|
<entry>GMT +4 hours</entry>
|
|
|
|
|
</row>
|
2000-10-20 15:57:10 +02:00
|
|
|
|
-->
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<row>
|
|
|
|
|
<entry>CDT</entry>
|
|
|
|
|
<entry>-5:00 </entry>
|
|
|
|
|
<entry>Central Daylight Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>EST</entry>
|
|
|
|
|
<entry>-5:00 </entry>
|
|
|
|
|
<entry>Eastern Standard Time</entry>
|
|
|
|
|
</row>
|
2000-10-20 15:57:10 +02:00
|
|
|
|
<!--
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<row>
|
|
|
|
|
<entry>ZP5</entry>
|
|
|
|
|
<entry>-5:00</entry>
|
|
|
|
|
<entry>GMT +5 hours</entry>
|
|
|
|
|
</row>
|
2000-10-20 15:57:10 +02:00
|
|
|
|
-->
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<row>
|
|
|
|
|
<entry>CST</entry>
|
|
|
|
|
<entry>-6:00 </entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Central Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>MDT</entry>
|
|
|
|
|
<entry>-6:00</entry>
|
|
|
|
|
<entry>Mountain Daylight Time</entry>
|
|
|
|
|
</row>
|
2000-10-20 15:57:10 +02:00
|
|
|
|
<!--
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<row>
|
|
|
|
|
<entry>ZP6</entry>
|
|
|
|
|
<entry>-6:00</entry>
|
|
|
|
|
<entry>GMT +6 hours</entry>
|
|
|
|
|
</row>
|
2000-10-20 15:57:10 +02:00
|
|
|
|
-->
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<row>
|
|
|
|
|
<entry>MST</entry>
|
|
|
|
|
<entry>-7:00</entry>
|
|
|
|
|
<entry>Mountain Standard Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>PDT</entry>
|
|
|
|
|
<entry>-7:00</entry>
|
|
|
|
|
<entry>Pacific Daylight Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>PST</entry>
|
|
|
|
|
<entry>-8:00</entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Pacific Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>YDT</entry>
|
|
|
|
|
<entry>-8:00</entry>
|
|
|
|
|
<entry>Yukon Daylight Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>HDT</entry>
|
|
|
|
|
<entry>-9:00</entry>
|
|
|
|
|
<entry>Hawaii/Alaska Daylight Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>YST</entry>
|
|
|
|
|
<entry>-9:00</entry>
|
|
|
|
|
<entry>Yukon Standard Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>AHST</entry>
|
|
|
|
|
<entry>-10:00 </entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>Alaska-Hawaii Standard Time</entry>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>CAT</entry>
|
|
|
|
|
<entry>-10:00 </entry>
|
|
|
|
|
<entry>Central Alaska Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>NT</entry>
|
|
|
|
|
<entry>-11:00</entry>
|
|
|
|
|
<entry>Nome Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>IDLW</entry>
|
|
|
|
|
<entry>-12:00</entry>
|
|
|
|
|
<entry>International Date Line, West</entry>
|
|
|
|
|
</row>
|
|
|
|
|
</tbody>
|
|
|
|
|
</tgroup>
|
|
|
|
|
</table>
|
|
|
|
|
</para>
|
|
|
|
|
|
2000-02-02 17:21:06 +01:00
|
|
|
|
<sect2>
|
|
|
|
|
<title>Australian Time Zones</title>
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
Australian time zones and their naming variants
|
|
|
|
|
account for fully one quarter of all time zones in the
|
|
|
|
|
<productname>Postgres</productname> time zone lookup table.
|
2001-06-18 21:05:11 +02:00
|
|
|
|
There are two naming conflicts with time zones commonly used
|
2000-02-02 17:21:06 +01:00
|
|
|
|
in the United States, <literal>CST</literal> and <literal>EST</literal>.
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
If the runtime option <literal>AUSTRALIAN_TIMEZONES</literal> is set
|
2000-10-20 15:57:10 +02:00
|
|
|
|
then <literal>CST</literal>, <literal>EST</literal>, and
|
|
|
|
|
<literal>SAT</literal> will be
|
2001-06-18 21:05:11 +02:00
|
|
|
|
interpreted as Australian timezone names. Without this option,
|
|
|
|
|
<literal>CST</literal> and <literal>EST</literal> are taken as
|
|
|
|
|
American timezone names, while <literal>SAT</literal> is interpreted as a
|
2001-09-13 17:55:24 +02:00
|
|
|
|
noise word indicating <literal>Saturday</literal>.
|
2000-02-02 17:21:06 +01:00
|
|
|
|
|
|
|
|
|
<table tocentry="1">
|
|
|
|
|
<title><productname>Postgres</productname> Australian Time Zones</title>
|
|
|
|
|
<titleabbrev>Australian Time Zones</titleabbrev>
|
|
|
|
|
<tgroup cols="3">
|
|
|
|
|
<thead>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>Time Zone</entry>
|
|
|
|
|
<entry>Offset from UTC</entry>
|
|
|
|
|
<entry>Description</entry>
|
|
|
|
|
</row>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>CST</entry>
|
|
|
|
|
<entry>+10:30</entry>
|
|
|
|
|
<entry>Australian Central Standard Time</entry>
|
|
|
|
|
</row>
|
|
|
|
|
<row>
|
|
|
|
|
<entry>EST</entry>
|
|
|
|
|
<entry>+10:00</entry>
|
|
|
|
|
<entry>Australian Eastern Standard Time</entry>
|
|
|
|
|
</row>
|
2000-10-20 15:57:10 +02:00
|
|
|
|
<row>
|
|
|
|
|
<entry>SAT</entry>
|
|
|
|
|
<entry>+9:30</entry>
|
2001-06-18 21:05:11 +02:00
|
|
|
|
<entry>South Australian Standard Time</entry>
|
2000-10-20 15:57:10 +02:00
|
|
|
|
</row>
|
2000-02-02 17:21:06 +01:00
|
|
|
|
</tbody>
|
|
|
|
|
</tgroup>
|
|
|
|
|
</table>
|
|
|
|
|
</para>
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
|
|
<sect2>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<title>Date/Time Input Interpretation</title>
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
The date/time types are all decoded using a common set of routines.
|
|
|
|
|
</para>
|
|
|
|
|
|
2000-02-02 17:21:06 +01:00
|
|
|
|
<procedure>
|
|
|
|
|
<title>Date/Time Input Interpretation</title>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
Break the input string into tokens and categorize each token as
|
|
|
|
|
a string, time, time zone, or number.
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<substeps>
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
If the token contains a colon (":"), this is a time string.
|
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
If the token contains a dash ("-"), slash ("/"), or dot ("."),
|
|
|
|
|
this is a date string which may have a text month.
|
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
If the token is numeric only, then it is either a single field
|
2001-09-13 17:55:24 +02:00
|
|
|
|
or an ISO-8601 concatenated date (e.g. <literal>19990113</literal> for January 13, 1999)
|
2000-02-02 17:21:06 +01:00
|
|
|
|
or time (e.g. 141516 for 14:15:16).
|
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
If the token starts with a plus ("+") or minus ("-"),
|
|
|
|
|
then it is either a time zone or a special field.
|
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
</substeps>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
If the token is a text string, match up with possible strings.
|
|
|
|
|
</para>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
|
2000-02-02 17:21:06 +01:00
|
|
|
|
<substeps>
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
Do a binary-search table lookup for the token
|
|
|
|
|
as either a special string (e.g. <literal>today</literal>),
|
|
|
|
|
day (e.g. <literal>Thursday</literal>),
|
|
|
|
|
month (e.g. <literal>January</literal>),
|
|
|
|
|
or noise word (e.g. <literal>on</literal>).
|
|
|
|
|
</para>
|
|
|
|
|
<para>
|
|
|
|
|
Set field values and bit mask for fields.
|
|
|
|
|
For example, set year, month, day for <literal>today</literal>,
|
|
|
|
|
and additionally hour, minute, second for <literal>now</literal>.
|
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
If not found, do a similar binary-search table lookup to match
|
|
|
|
|
the token with a time zone.
|
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
If not found, throw an error.
|
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
</substeps>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
The token is a number or number field.
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<substeps>
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
If there are more than 4 digits,
|
|
|
|
|
and if no other date fields have been previously read, then interpret
|
2001-09-13 17:55:24 +02:00
|
|
|
|
as a <quote>concatenated date</quote> (e.g. <literal>19990118</literal>). 8
|
2000-02-02 17:21:06 +01:00
|
|
|
|
and 6 digits are interpreted as year, month, and day, while 7
|
|
|
|
|
and 5 digits are interpreted as year, day of year, respectively.
|
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
If the token is three digits
|
|
|
|
|
and a year has already been decoded, then interpret as day of year.
|
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
2000-03-29 05:57:11 +02:00
|
|
|
|
If four or more digits, then interpret as a year.
|
2000-02-02 17:21:06 +01:00
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<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>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<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>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<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 day.
|
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
2000-03-29 05:57:11 +02:00
|
|
|
|
If two digits or four or more digits, then interpret as a year.
|
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
Otherwise, throw an error.
|
2000-02-02 17:21:06 +01:00
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
</substeps>
|
|
|
|
|
</step>
|
|
|
|
|
|
|
|
|
|
<step>
|
|
|
|
|
<para>
|
|
|
|
|
If BC has been specified, negate the year and offset by one for
|
|
|
|
|
internal storage
|
|
|
|
|
(there is no year zero in the Gregorian calendar, so numerically
|
|
|
|
|
1BC becomes year zero).
|
|
|
|
|
</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.
|
|
|
|
|
|
|
|
|
|
<tip>
|
|
|
|
|
<para>
|
|
|
|
|
Gregorian years 1-99AD may be entered by using 4 digits with leading
|
2000-03-29 05:57:11 +02:00
|
|
|
|
zeros (e.g. 0099 is 99AD). Previous versions of
|
|
|
|
|
<productname>Postgres</productname> accepted years with three
|
2000-12-21 23:55:27 +01:00
|
|
|
|
digits and with single digits, but as of version 7.0 the rules have
|
2000-03-29 05:57:11 +02:00
|
|
|
|
been tightened up to reduce the possibility of ambiguity.
|
2000-02-02 17:21:06 +01:00
|
|
|
|
</para>
|
|
|
|
|
</tip>
|
|
|
|
|
</para>
|
|
|
|
|
</step>
|
|
|
|
|
</procedure>
|
|
|
|
|
</sect2>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</sect1>
|
1999-05-20 07:39:29 +02:00
|
|
|
|
|
2000-09-29 22:21:34 +02:00
|
|
|
|
<sect1 id="units-history">
|
2000-05-02 22:36:21 +02:00
|
|
|
|
<title>History of Units</title>
|
1999-05-20 07:39:29 +02:00
|
|
|
|
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<note>
|
|
|
|
|
<para>
|
2000-12-22 22:51:58 +01:00
|
|
|
|
Contributed by Jos<6F> Soares (<email>jose@sferacarta.com</email>)
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</para>
|
|
|
|
|
</note>
|
1999-05-20 07:39:29 +02:00
|
|
|
|
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<para>
|
1999-06-23 08:17:51 +02:00
|
|
|
|
The Julian Day was invented by the French scholar
|
1999-05-22 04:27:25 +02:00
|
|
|
|
Joseph Justus Scaliger (1540-1609)
|
1999-06-23 08:17:51 +02:00
|
|
|
|
and probably takes its name from the Scaliger's father,
|
1999-05-22 04:27:25 +02:00
|
|
|
|
the Italian scholar Julius Caesar Scaliger (1484-1558).
|
|
|
|
|
Astronomers have used the Julian period to assign a unique number to
|
|
|
|
|
every day since 1 January 4713 BC. This is the so-called Julian Day
|
|
|
|
|
(JD). JD 0 designates the 24 hours from noon UTC on 1 January 4713 BC
|
|
|
|
|
to noon UTC on 2 January 4713 BC.
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>
|
2001-09-13 17:55:24 +02:00
|
|
|
|
<quote>Julian Day</quote> is different from <quote>Julian Date</quote>.
|
1999-05-22 04:27:25 +02:00
|
|
|
|
|
|
|
|
|
The Julian calendar was introduced by Julius Caesar in 45 BC. It was
|
|
|
|
|
in common use until the 1582, when countries started changing to the
|
|
|
|
|
Gregorian calendar.
|
|
|
|
|
|
|
|
|
|
In the Julian calendar, the tropical year is approximated as 365 1/4
|
2000-10-20 15:57:10 +02:00
|
|
|
|
days = 365.25 days. This gives an error of about 1 day in
|
|
|
|
|
128 years.
|
|
|
|
|
The accumulating calendar error prompted Pope Gregory XIII
|
1999-05-22 04:27:25 +02:00
|
|
|
|
to reform the calendar in accordance with instructions
|
|
|
|
|
from the Council of Trent.
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
In the Gregorian calendar, the tropical year is approximated as
|
|
|
|
|
365 + 97 / 400 days = 365.2425 days. Thus it takes approximately 3300
|
|
|
|
|
years for the tropical year to shift one day with respect to the
|
|
|
|
|
Gregorian calendar.
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
The approximation 365+97/400 is achieved by having 97 leap years
|
|
|
|
|
every 400 years, using the following rules:
|
|
|
|
|
|
|
|
|
|
<simplelist>
|
|
|
|
|
<member>
|
1999-06-23 08:17:51 +02:00
|
|
|
|
Every year divisible by 4 is a leap year.
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</member>
|
|
|
|
|
<member>
|
1999-06-23 08:17:51 +02:00
|
|
|
|
However, every year divisible by 100 is not a leap year.
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</member>
|
|
|
|
|
<member>
|
1999-06-23 08:17:51 +02:00
|
|
|
|
However, every year divisible by 400 is a leap year after all.
|
1999-05-22 04:27:25 +02:00
|
|
|
|
</member>
|
|
|
|
|
</simplelist>
|
|
|
|
|
|
|
|
|
|
So, 1700, 1800, 1900, 2100, and 2200 are not leap years. But 1600,
|
|
|
|
|
2000, and 2400 are leap years.
|
|
|
|
|
|
|
|
|
|
By contrast, in the older Julian calendar only years divisible by 4 are leap years.
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
The papal bull of February 1582 decreed that 10 days should be dropped
|
|
|
|
|
from October 1582 so that 15 October should follow immediately after
|
|
|
|
|
4 October.
|
|
|
|
|
This was observed in Italy, Poland, Portugal, and Spain. Other Catholic
|
|
|
|
|
countries followed shortly after, but Protestant countries were
|
|
|
|
|
reluctant to change, and the Greek orthodox countries didn't change
|
|
|
|
|
until the start of this century.
|
|
|
|
|
|
|
|
|
|
The reform was observed by Great Britain and Dominions (including what is
|
|
|
|
|
now the USA) in 1752.
|
|
|
|
|
Thus 2 Sep 1752 was followed by 14 Sep 1752.
|
|
|
|
|
|
|
|
|
|
This is why Unix systems have <application>cal</application>
|
|
|
|
|
produce the following:
|
|
|
|
|
|
|
|
|
|
<programlisting>
|
|
|
|
|
% cal 9 1752
|
|
|
|
|
September 1752
|
|
|
|
|
S M Tu W Th F S
|
|
|
|
|
1 2 14 15 16
|
|
|
|
|
17 18 19 20 21 22 23
|
|
|
|
|
24 25 26 27 28 29 30
|
|
|
|
|
</programlisting>
|
|
|
|
|
</para>
|
1999-05-20 07:39:29 +02:00
|
|
|
|
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<note>
|
|
|
|
|
<para>
|
|
|
|
|
SQL92 states that
|
|
|
|
|
<quote>Within the definition of a <sgmltag>datetime literal</sgmltag>,
|
|
|
|
|
the <sgmltag>datetime value</sgmltag>s are constrained by the
|
|
|
|
|
natural rules for dates and times
|
|
|
|
|
according to the Gregorian calendar</quote>.
|
|
|
|
|
Dates between 1752-09-03 and 1752-09-13, although eliminated in
|
|
|
|
|
some countries by Papal fiat, conform to
|
|
|
|
|
<quote>natural rules</quote> and are hence valid dates.
|
|
|
|
|
</para>
|
|
|
|
|
</note>
|
1999-05-20 07:39:29 +02:00
|
|
|
|
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<para>
|
|
|
|
|
Different calendars have been developed in various parts of the
|
|
|
|
|
world, many predating the Gregorian system.
|
1999-05-20 07:39:29 +02:00
|
|
|
|
|
1999-05-22 04:27:25 +02:00
|
|
|
|
For example,
|
|
|
|
|
the beginnings of the Chinese calendar can be traced back to the 14th
|
|
|
|
|
century BC. Legend has it that the Emperor Huangdi invented the
|
|
|
|
|
calendar in 2637 BC.
|
|
|
|
|
|
|
|
|
|
The People's Republic of China uses the Gregorian calendar
|
|
|
|
|
for civil purposes. Chinese calendar is used for determining
|
|
|
|
|
festivals.
|
|
|
|
|
</para>
|
|
|
|
|
</sect1>
|
|
|
|
|
</appendix>
|
1999-05-20 07:39:29 +02:00
|
|
|
|
|
1999-05-22 04:27:25 +02:00
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
|
Local variables:
|
2000-03-31 05:27:42 +02:00
|
|
|
|
mode:sgml
|
1999-05-22 04:27:25 +02:00
|
|
|
|
sgml-omittag:nil
|
|
|
|
|
sgml-shorttag:t
|
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
|
sgml-indent-step:1
|
|
|
|
|
sgml-indent-data:t
|
|
|
|
|
sgml-parent-document:nil
|
|
|
|
|
sgml-default-dtd-file:"./reference.ced"
|
|
|
|
|
sgml-exposed-tags:nil
|
2000-03-31 05:27:42 +02:00
|
|
|
|
sgml-local-catalogs:("/usr/lib/sgml/catalog")
|
1999-05-22 04:27:25 +02:00
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
|
End:
|
|
|
|
|
-->
|