]> granicus.if.org Git - postgresql/blob - doc/src/sgml/datetime.sgml
This patch makes it possible to use the full set of timezones when doing
[postgresql] / doc / src / sgml / datetime.sgml
1 <!--
2 $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.46 2005/06/15 00:34:08 momjian Exp $
3 -->
4
5  <appendix id="datetime-appendix">
6   <title>Date/Time Support</title>
7
8   <para>
9    <productname>PostgreSQL</productname> uses an internal heuristic
10    parser for all date/time input support. Dates and times are input as
11    strings, and are broken up into distinct fields with a preliminary
12    determination of what kind of information may be in the
13    field. Each field is interpreted and either assigned a numeric
14    value, ignored, or rejected.
15    The parser contains internal lookup tables for all textual fields,
16    including months, days of the week, and time zones.
17   </para>
18
19   <para>
20    This appendix includes information on the content of these
21    lookup tables and describes the steps used by the parser to decode
22    dates and times.
23   </para>
24
25   <sect1>
26    <title>Date/Time Input Interpretation</title>
27
28    <para>
29     The date/time type inputs are all decoded using the following procedure.
30    </para>
31
32    <procedure>
33     <step>
34      <para>
35       Break the input string into tokens and categorize each token as
36       a string, time, time zone, or number.
37      </para>
38
39      <substeps>
40       <step>
41        <para>
42         If the numeric token contains a colon (<literal>:</>), this is
43         a time string. Include all subsequent digits and colons.
44        </para>
45       </step>
46
47       <step>
48        <para>
49         If the numeric token contains a dash (<literal>-</>), slash
50         (<literal>/</>), or two or more dots (<literal>.</>), this is
51         a date string which may have a text month.
52        </para>
53       </step>
54
55       <step>
56        <para>
57         If the token is numeric only, then it is either a single field
58         or an ISO 8601 concatenated date (e.g.,
59         <literal>19990113</literal> for January 13, 1999) or time
60         (e.g., <literal>141516</literal> for 14:15:16).
61        </para>
62       </step>
63
64       <step>
65        <para>
66         If the token starts with a plus (<literal>+</>) or minus
67         (<literal>-</>), then it is either a time zone or a special
68         field.
69        </para>
70       </step>
71      </substeps>
72     </step>
73
74     <step>
75      <para>
76       If the token is a text string, match up with possible strings.
77      </para>
78      
79      <substeps>
80       <step>
81        <para>
82         Do a binary-search table lookup for the token
83         as either a special string (e.g., <literal>today</literal>),
84         day (e.g., <literal>Thursday</literal>),
85         month (e.g., <literal>January</literal>),
86         or noise word (e.g., <literal>at</literal>, <literal>on</literal>).
87        </para>
88
89        <para>
90         Set field values and bit mask for fields.
91         For example, set year, month, day for <literal>today</literal>,
92         and additionally hour, minute, second for <literal>now</literal>.
93        </para>
94       </step>
95       
96       <step>
97        <para>
98         If not found, do a similar binary-search table lookup to match
99         the token with a time zone.
100        </para>
101       </step>
102
103       <step>
104        <para>
105         If still not found, throw an error.
106        </para>
107       </step>
108      </substeps>
109     </step>
110     
111     <step>
112      <para>
113       When the token is a number or number field:
114      </para>
115
116      <substeps>
117       <step>
118        <para>
119         If there are eight or six digits,
120         and if no other date fields have been previously read, then interpret 
121         as a <quote>concatenated date</quote> (e.g.,
122         <literal>19990118</literal> or <literal>990118</literal>).
123         The interpretation is <literal>YYYYMMDD</> or <literal>YYMMDD</>.
124        </para>
125       </step>
126
127       <step>
128        <para>
129         If the token is three digits
130         and a year has already been read, then interpret as day of year.
131        </para>
132       </step>
133       
134       <step>
135        <para>
136         If four or six digits and a year has already been read, then
137         interpret as a time (<literal>HHMM</> or <literal>HHMMSS</>).
138        </para>
139       </step>
140
141       <step>
142        <para>
143         If three or more digits and no date fields have yet been found,
144         interpret as a year (this forces yy-mm-dd ordering of the remaining
145         date fields).
146        </para>
147       </step>
148
149       <step>
150        <para>
151         Otherwise the date field ordering is assumed to follow the
152         <varname>DateStyle</> setting: mm-dd-yy, dd-mm-yy, or yy-mm-dd.
153         Throw an error if a month or day field is found to be out of range.
154        </para>
155       </step>
156      </substeps>
157     </step>
158
159     <step>
160      <para>
161       If BC has been specified, negate the year and add one for
162       internal storage.  (There is no year zero in the Gregorian
163       calendar, so numerically 1 BC becomes year zero.)
164      </para>
165     </step>
166
167     <step>
168      <para>
169       If BC was not specified, and if the year field was two digits in length,
170       then adjust the year to four digits. If the field is less than 70, then
171       add 2000, otherwise add 1900.
172
173       <tip>
174        <para>
175         Gregorian years AD 1-99 may be entered by using 4 digits with leading
176         zeros (e.g., <literal>0099</> is AD 99). Previous versions of
177         <productname>PostgreSQL</productname> accepted years with three
178         digits and with single digits, but as of version 7.0 the rules have
179         been tightened up to reduce the possibility of ambiguity.
180        </para>
181       </tip>
182      </para>
183     </step>
184    </procedure>
185   </sect1>
186
187
188   <sect1 id="datetime-keywords">
189    <title>Date/Time Key Words</title>
190
191    <para>
192     <xref linkend="datetime-month-table"> shows the tokens that are
193     recognized as names of months.
194    </para>
195
196     <table id="datetime-month-table">
197      <title>Month Names</title>
198      <tgroup cols="2">
199       <thead>
200        <row>
201         <entry>Month</entry>
202         <entry>Abbreviations</entry>
203        </row>
204       </thead>
205       <tbody>
206        <row>
207         <entry>January</entry>
208         <entry>Jan</entry>
209        </row>
210        <row>
211         <entry>February</entry>
212         <entry>Feb</entry>
213        </row>
214        <row>
215         <entry>March</entry>
216         <entry>Mar</entry>
217        </row>
218        <row>
219         <entry>April</entry>
220         <entry>Apr</entry>
221        </row>
222        <row>
223         <entry>May</entry>
224         <entry></entry>
225        </row>
226        <row>
227         <entry>June</entry>
228         <entry>Jun</entry>
229        </row>
230        <row>
231         <entry>July</entry>
232         <entry>Jul</entry>
233        </row>
234        <row>
235         <entry>August</entry>
236         <entry>Aug</entry>
237        </row>
238        <row>
239         <entry>September</entry>
240         <entry>Sep, Sept</entry>
241        </row>
242        <row>
243         <entry>October</entry>
244         <entry>Oct</entry>
245        </row>
246        <row>
247         <entry>November</entry>
248         <entry>Nov</entry>
249        </row>
250        <row>
251         <entry>December</entry>
252         <entry>Dec</entry>
253        </row>
254       </tbody>
255      </tgroup>
256     </table>
257
258     <para>
259      <xref linkend="datetime-dow-table"> shows the tokens that are
260      recognized as names of days of the week.
261     </para>
262
263      <table id="datetime-dow-table">
264       <title>Day of the Week Names</title>
265       <tgroup cols="2">
266        <thead>
267         <row>
268          <entry>Day</entry>
269          <entry>Abbreviations</entry>
270         </row>
271        </thead>
272        <tbody>
273         <row>
274          <entry>Sunday</entry>
275          <entry>Sun</entry>
276         </row>
277         <row>
278          <entry>Monday</entry>
279          <entry>Mon</entry>
280         </row>
281         <row>
282          <entry>Tuesday</entry>
283          <entry>Tue, Tues</entry>
284         </row>
285         <row>
286          <entry>Wednesday</entry>
287          <entry>Wed, Weds</entry>
288         </row>
289         <row>
290          <entry>Thursday</entry>
291          <entry>Thu, Thur, Thurs</entry>
292         </row>
293         <row>
294          <entry>Friday</entry>
295          <entry>Fri</entry>
296         </row>
297         <row>
298          <entry>Saturday</entry>
299          <entry>Sat</entry>
300         </row>
301        </tbody>
302       </tgroup>
303      </table>
304
305    <para>
306     <xref linkend="datetime-mod-table"> shows the tokens that serve
307     various modifier purposes.
308    </para>
309
310     <table id="datetime-mod-table">
311      <title>Date/Time Field Modifiers</title>
312      <tgroup cols="2">
313       <thead>
314        <row>
315         <entry>Identifier</entry>
316         <entry>Description</entry>
317        </row>
318       </thead>
319       <tbody>
320        <row>
321         <entry><literal>ABSTIME</literal></entry>
322         <entry>Ignored</entry>
323        </row>
324        <row>
325         <entry><literal>AM</literal></entry>
326         <entry>Time is before 12:00</entry>
327        </row>
328        <row>
329         <entry><literal>AT</literal></entry>
330         <entry>Ignored</entry>
331        </row>
332        <row>
333         <entry><literal>JULIAN</>, <literal>JD</>, <literal>J</></entry>
334         <entry>Next field is Julian Day</entry>
335        </row>
336        <row>
337         <entry><literal>ON</literal></entry>
338         <entry>Ignored</entry>
339        </row>
340        <row>
341         <entry><literal>PM</literal></entry>
342         <entry>Time is on or after 12:00</entry>
343        </row>
344        <row>
345         <entry><literal>T</literal></entry>
346         <entry>Next field is time</entry>
347        </row>
348       </tbody>
349      </tgroup>
350     </table>
351
352    <para>
353     The key word <literal>ABSTIME</literal> is ignored for historical
354     reasons: In very old releases of
355     <productname>PostgreSQL</productname>, invalid values of type <type>abstime</type>
356     were emitted as <literal>Invalid Abstime</literal>. This is no
357     longer the case however and this key word will likely be dropped in
358     a future release.
359    </para>
360
361    <indexterm>
362     <primary>time zone</primary>
363     <secondary>input abbreviations</secondary>
364    </indexterm>
365
366    <para>
367     <xref linkend="datetime-timezone-input-table"> shows the time zone
368     abbreviations recognized by <productname>PostgreSQL</productname>
369     in date/time input values.  Note that these names are <emphasis>not</>
370     necessarily used for date/time output &mdash; output is driven by the
371     official timezone abbreviation(s) associated with the currently selected
372     <xref linkend="guc-timezone"> parameter setting.  (It is
373     likely that future releases will make some use of <varname>timezone</>
374     for input as well.)
375    </para>
376
377    <para>
378     The table is organized by time zone offset from <acronym>UTC</>,
379     rather than alphabetically.  This is intended to facilitate
380     matching local usage with recognized abbreviations for cases where
381     these might differ.
382    </para>
383
384     <table id="datetime-timezone-input-table">
385      <title>Time Zone Abbreviations for Input</title>
386      <tgroup cols="3">
387       <thead>
388        <row>
389         <entry>Time Zone</entry>
390         <entry>Offset from UTC</entry>
391         <entry>Description</entry>
392        </row>
393       </thead>
394       <tbody>
395        <row>
396         <entry>NZDT</entry>
397         <entry>+13:00</entry>
398         <entry>New Zealand Daylight-Saving Time</entry>
399        </row>
400        <row>
401         <entry>IDLE</entry>
402         <entry>+12:00</entry>
403         <entry>International Date Line, East</entry>
404        </row>
405        <row>
406         <entry>NZST</entry>
407         <entry>+12:00</entry>
408         <entry>New Zealand Standard Time</entry>
409        </row>
410        <row>
411         <entry>NZT</entry>
412         <entry>+12:00</entry>
413         <entry>New Zealand Time</entry>
414        </row>
415        <row>
416         <entry>AESST</entry>
417         <entry>+11:00</entry>
418         <entry>Australia Eastern Summer Standard Time</entry>
419        </row>
420        <row>
421         <entry>ACSST</entry>
422         <entry>+10:30</entry>
423         <entry>Central Australia Summer Standard Time</entry>
424        </row>
425        <row>
426         <entry>CADT</entry>
427         <entry>+10:30</entry>
428         <entry>Central Australia Daylight-Saving Time</entry>
429        </row>
430        <row>
431         <entry>SADT</entry>
432         <entry>+10:30</entry>
433         <entry>South Australian Daylight-Saving Time</entry>
434        </row>
435        <row>
436         <entry>AEST</entry>
437         <entry>+10:00</entry>
438         <entry>Australia Eastern Standard Time</entry>
439        </row>
440        <row>
441         <entry>EAST</entry>
442         <entry>+10:00</entry>
443         <entry>East Australian Standard Time</entry>
444        </row>
445        <row>
446         <entry>GST</entry>
447         <entry>+10:00</entry>
448         <entry>Guam Standard Time, Russia zone 9</entry>
449        </row>
450        <row>
451         <entry>LIGT</entry>
452         <entry>+10:00</entry>
453         <entry>Melbourne, Australia</entry>
454        </row>
455        <row>
456         <entry>SAST</entry>
457         <entry>+09:30</entry>
458         <entry>South Australia Standard Time</entry>
459        </row>
460        <row>
461         <entry>CAST</entry>
462         <entry>+09:30</entry>
463         <entry>Central Australia Standard Time</entry>
464        </row>
465        <row>
466         <entry>AWSST</entry>
467         <entry>+09:00</entry>
468         <entry>Australia Western Summer Standard Time</entry>
469        </row>
470        <row>
471         <entry>JST</entry>
472         <entry>+09:00</entry>
473         <entry>Japan Standard Time, Russia zone 8</entry>
474        </row>
475        <row>
476         <entry>KST</entry>
477         <entry>+09:00</entry>
478         <entry>Korea Standard Time</entry>
479        </row>
480        <row>
481         <entry>MHT</entry>
482         <entry>+09:00</entry>
483         <entry>Kwajalein Time</entry>
484        </row>
485        <row>
486         <entry>WDT</entry>
487         <entry>+09:00</entry>
488         <entry>West Australian Daylight-Saving Time</entry>
489        </row>
490        <row>
491         <entry>MT</entry>
492         <entry>+08:30</entry>
493         <entry>Moluccas Time</entry>
494        </row>
495        <row>
496         <entry>AWST</entry>
497         <entry>+08:00</entry>
498         <entry>Australia Western Standard Time</entry>
499        </row>
500        <row>
501         <entry>CCT</entry>
502         <entry>+08:00</entry>
503         <entry>China Coastal Time</entry>
504        </row>
505        <row>
506         <entry>WADT</entry>
507         <entry>+08:00</entry>
508         <entry>West Australian Daylight-Saving Time</entry>
509        </row>
510        <row>
511         <entry>WST</entry>
512         <entry>+08:00</entry>
513         <entry>West Australian Standard Time</entry>
514        </row>
515        <row>
516         <entry>JT</entry>
517         <entry>+07:30</entry>
518         <entry>Java Time</entry>
519        </row>
520        <row>
521         <entry>ALMST</entry>
522         <entry>+07:00</entry>
523         <entry>Almaty Summer Time</entry>
524        </row>
525        <row>
526         <entry>WAST</entry>
527         <entry>+07:00</entry>
528         <entry>West Australian Standard Time</entry>
529        </row>
530        <row>
531         <entry>CXT</entry>
532         <entry>+07:00</entry>
533         <entry>Christmas (Island) Time</entry>
534        </row>
535        <row>
536         <entry>MMT</entry>
537         <entry>+06:30</entry>
538         <entry>Myanmar Time</entry>
539        </row>
540        <row>
541         <entry>ALMT</entry>
542         <entry>+06:00</entry>
543         <entry>Almaty Time</entry>
544        </row>
545        <row>
546         <entry>MAWT</entry>
547         <entry>+06:00</entry>
548         <entry>Mawson (Antarctica) Time</entry>
549        </row>
550        <row>
551         <entry>IOT</entry>
552         <entry>+05:00</entry>
553         <entry>Indian Chagos Time</entry>
554        </row>
555        <row>
556         <entry>MVT</entry>
557         <entry>+05:00</entry>
558         <entry>Maldives Island Time</entry>
559        </row>
560        <row>
561         <entry>TFT</entry>
562         <entry>+05:00</entry>
563         <entry>Kerguelen Time</entry>
564        </row>
565        <row>
566         <entry>AFT</entry>
567         <entry>+04:30</entry>
568         <entry>Afghanistan Time</entry>
569        </row>
570        <row>
571         <entry>EAST</entry>
572         <entry>+04:00</entry>
573         <entry>Antananarivo Summer Time</entry>
574        </row>
575        <row>
576         <entry>MUT</entry>
577         <entry>+04:00</entry>
578         <entry>Mauritius Island Time</entry>
579        </row>
580        <row>
581         <entry>RET</entry>
582         <entry>+04:00</entry>
583         <entry>Reunion Island Time</entry>
584        </row>
585        <row>
586         <entry>SCT</entry>
587         <entry>+04:00</entry>
588         <entry>Mahe Island Time</entry>
589        </row>
590        <row>
591         <entry>IRT, IT</entry>
592         <entry>+03:30</entry>
593         <entry>Iran Time</entry>
594        </row>
595        <row>
596         <entry>EAT</entry>
597         <entry>+03:00</entry>
598         <entry>Antananarivo, Comoro Time</entry>
599        </row>
600        <row>
601         <entry>BT</entry>
602         <entry>+03:00</entry>
603         <entry>Baghdad Time</entry>
604        </row>
605        <row>
606         <entry>EETDST</entry>
607         <entry>+03:00</entry>
608         <entry>Eastern Europe Daylight-Saving Time</entry>
609        </row>
610        <row>
611         <entry>HMT</entry>
612         <entry>+03:00</entry>
613         <entry>Hellas Mediterranean Time (?)</entry>
614        </row>
615        <row>
616         <entry>BDST</entry>
617         <entry>+02:00</entry>
618         <entry>British Double Summer Time</entry>
619        </row>
620        <row>
621         <entry>CEST</entry>
622         <entry>+02:00</entry>
623         <entry>Central European Summer Time</entry>
624        </row>
625        <row>
626         <entry>CETDST</entry>
627         <entry>+02:00</entry>
628         <entry>Central European Daylight-Saving Time</entry>
629        </row>
630        <row>
631         <entry>EET</entry>
632         <entry>+02:00</entry>
633         <entry>Eastern European Time, Russia zone 1</entry>
634        </row>
635        <row>
636         <entry>FWT</entry>
637         <entry>+02:00</entry>
638         <entry>French Winter Time</entry>
639        </row>
640        <row>
641         <entry>IST</entry>
642         <entry>+02:00</entry>
643         <entry>Israel Standard Time</entry>
644        </row>
645        <row>
646         <entry>MEST</entry>
647         <entry>+02:00</entry>
648         <entry>Middle European Summer Time</entry>
649        </row>
650        <row>
651         <entry>METDST</entry>
652         <entry>+02:00</entry>
653         <entry>Middle Europe Daylight-Saving Time</entry>
654        </row>
655        <row>
656         <entry>SST</entry>
657         <entry>+02:00</entry>
658         <entry>Swedish Summer Time</entry>
659        </row>
660        <row>
661         <entry>BST</entry>
662         <entry>+01:00</entry>
663         <entry>British Summer Time</entry>
664        </row>
665        <row>
666         <entry>CET</entry>
667         <entry>+01:00</entry>
668         <entry>Central European Time</entry>
669        </row>
670        <row>
671         <entry>DNT</entry>
672         <entry>+01:00</entry>
673         <entry><foreignphrase>Dansk Normal Tid</foreignphrase></entry>
674        </row>
675        <row>
676         <entry>FST</entry>
677         <entry>+01:00</entry>
678         <entry>French Summer Time</entry>
679        </row>
680        <row>
681         <entry>MET</entry>
682         <entry>+01:00</entry>
683         <entry>Middle European Time</entry>
684        </row>
685        <row>
686         <entry>MEWT</entry>
687         <entry>+01:00</entry>
688         <entry>Middle European Winter Time</entry>
689        </row>
690        <row>
691         <entry>MEZ</entry>
692         <entry>+01:00</entry>
693         <entry><foreignphrase>Mitteleuropäische Zeit</></entry>
694        </row>
695        <row>
696         <entry>NOR</entry>
697         <entry>+01:00</entry>
698         <entry>Norway Standard Time</entry>
699        </row>
700        <row>
701         <entry>SET</entry>
702         <entry>+01:00</entry>
703         <entry>Seychelles Time</entry>
704        </row>
705        <row>
706         <entry>SWT</entry>
707         <entry>+01:00</entry>
708         <entry>Swedish Winter Time</entry>
709        </row>
710        <row>
711         <entry>WETDST</entry>
712         <entry>+01:00</entry>
713         <entry>Western European Daylight-Saving Time</entry>
714        </row>
715        <row>
716         <entry>GMT</entry>
717         <entry>00:00</entry>
718         <entry>Greenwich Mean Time</entry>
719        </row>
720        <row>
721         <entry>UT</entry>
722         <entry>00:00</entry>
723         <entry>Universal Time</entry>
724        </row>
725        <row>
726         <entry>UTC</entry>
727         <entry>00:00</entry>
728         <entry>Universal Coordinated Time</entry>
729        </row>
730        <row>
731         <entry>Z</entry>
732         <entry>00:00</entry>
733         <entry>Same as UTC</entry>
734        </row>
735        <row>
736         <entry>ZULU</entry>
737         <entry>00:00</entry>
738         <entry>Same as UTC</entry>
739        </row>
740        <row>
741         <entry>WET</entry>
742         <entry>00:00</entry>
743         <entry>Western European Time</entry>
744        </row>
745        <row>
746         <entry>WAT</entry>
747         <entry>-01:00</entry>
748         <entry>West Africa Time</entry>
749        </row>
750        <row>
751         <entry>FNST</entry>
752         <entry>-01:00</entry>
753         <entry>Fernando de Noronha Summer Time</entry>
754        </row>
755        <row>
756         <entry>FNT</entry>
757         <entry>-02:00</entry>
758         <entry>Fernando de Noronha Time</entry>
759        </row>
760        <row>
761         <entry>BRST</entry>
762         <entry>-02:00</entry>
763         <entry>Brasilia Summer Time</entry>
764        </row>
765        <row>
766         <entry>NDT</entry>
767         <entry>-02:30</entry>
768         <entry>Newfoundland Daylight-Saving Time</entry>
769        </row>
770        <row>
771         <entry>ADT</entry>
772         <entry>-03:00</entry>
773         <entry>Atlantic Daylight-Saving Time</entry>
774        </row>
775        <row>
776         <entry>AWT</entry>
777         <entry>-03:00</entry>
778         <entry>(unknown)</entry>
779        </row>
780        <row>
781         <entry>BRT</entry>
782         <entry>-03:00</entry>
783         <entry>Brasilia Time</entry>
784        </row>
785        <row>
786         <entry>NFT</entry>
787         <entry>-03:30</entry>
788         <entry>Newfoundland Standard Time</entry>
789        </row>
790        <row>
791         <entry>NST</entry>
792         <entry>-03:30</entry>
793         <entry>Newfoundland Standard Time</entry>
794        </row>
795        <row>
796         <entry>AST</entry>
797         <entry>-04:00</entry>
798         <entry>Atlantic Standard Time (Canada)</entry>
799        </row>
800        <row>
801         <entry>ACST</entry>
802         <entry>-04:00</entry>
803         <entry>Atlantic/Porto Acre Summer Time</entry>
804        </row>
805        <row>
806         <entry>EDT</entry>
807         <entry>-04:00</entry>
808         <entry>Eastern Daylight-Saving Time</entry>
809        </row>
810        <!--
811       <row>
812       <entry>ZP4</entry>
813       <entry>-04:00</entry>
814       <entry>GMT +4 hours</entry>
815       </row>
816        -->
817        <row>
818         <entry>ACT</entry>
819         <entry>-05:00</entry>
820         <entry>Atlantic/Porto Acre Standard Time</entry>
821        </row>
822        <row>
823         <entry>CDT</entry>
824         <entry>-05:00</entry>
825         <entry>Central Daylight-Saving Time</entry>
826        </row>
827        <row>
828         <entry>EST</entry>
829         <entry>-05:00</entry>
830         <entry>Eastern Standard Time</entry>
831        </row>
832        <!--
833       <row>
834       <entry>ZP5</entry>
835       <entry>-05:00</entry>
836       <entry>GMT +5  hours</entry>
837       </row>
838        -->
839        <row>
840         <entry>CST</entry>
841         <entry>-06:00</entry>
842         <entry>Central Standard Time</entry>
843        </row>
844        <row>
845         <entry>MDT</entry>
846         <entry>-06:00</entry>
847         <entry>Mountain Daylight-Saving Time</entry>
848        </row>
849        <!--
850       <row>
851       <entry>ZP6</entry>
852       <entry>-06:00</entry>
853       <entry>GMT +6  hours</entry>
854       </row>
855        -->
856        <row>
857         <entry>MST</entry>
858         <entry>-07:00</entry>
859         <entry>Mountain Standard Time</entry>
860        </row>
861        <row>
862         <entry>PDT</entry>
863         <entry>-07:00</entry>
864         <entry>Pacific Daylight-Saving Time</entry>
865        </row>
866        <row>
867         <entry>AKDT</entry>
868         <entry>-08:00</entry>
869         <entry>Alaska Daylight-Saving Time</entry>
870        </row>
871        <row>
872         <entry>PST</entry>
873         <entry>-08:00</entry>
874         <entry>Pacific Standard Time</entry>
875        </row>
876        <row>
877         <entry>YDT</entry>
878         <entry>-08:00</entry>
879         <entry>Yukon Daylight-Saving Time</entry>
880        </row>
881        <row>
882         <entry>AKST</entry>
883         <entry>-09:00</entry>
884         <entry>Alaska Standard Time</entry>
885        </row>
886        <row>
887         <entry>HDT</entry>
888         <entry>-09:00</entry>
889         <entry>Hawaii/Alaska Daylight-Saving Time</entry>
890        </row>
891        <row>
892         <entry>YST</entry>
893         <entry>-09:00</entry>
894         <entry>Yukon Standard Time</entry>
895        </row>
896        <row>
897         <entry>MART</entry>
898         <entry>-09:30</entry>
899         <entry>Marquesas Time</entry>
900        </row>
901        <row>
902         <entry>AHST</entry>
903         <entry>-10:00</entry>
904         <entry>Alaska/Hawaii Standard Time</entry>
905        </row>
906        <row>
907         <entry>HST</entry>
908         <entry>-10:00</entry>
909         <entry>Hawaii Standard Time</entry>
910        </row>
911        <row>
912         <entry>CAT</entry>
913         <entry>-10:00</entry>
914         <entry>Central Alaska Time</entry>
915        </row>
916        <row>
917         <entry>NT</entry>
918         <entry>-11:00</entry>
919         <entry>Nome Time</entry>
920        </row>
921        <row>
922         <entry>IDLW</entry>
923         <entry>-12:00</entry>
924         <entry>International Date Line, West</entry>
925        </row>
926       </tbody>
927      </tgroup>
928     </table>
929
930   <formalpara>
931    <title>Australian Time Zones</title>
932
933    <para>
934     There are three naming conflicts between Australian time zone
935     names and time zone names commonly used in North and South America:
936     <literal>ACST</literal>, <literal>CST</literal>, and
937     <literal>EST</literal>.  If the run-time option
938     <varname>australian_timezones</varname> is set to true then
939     <literal>ACST</literal>, <literal>CST</literal>,
940     <literal>EST</literal>, and <literal>SAT</literal> are interpreted
941     as Australian time zone names, as shown in <xref
942     linkend="datetime-oztz-table">. If it is false (which is the
943     default), then <literal>ACST</literal>, <literal>CST</literal>,
944     and <literal>EST</literal> are taken as American time zone names,
945     and <literal>SAT</literal> is interpreted as a noise word
946     indicating Saturday.
947    </para>
948   </formalpara>
949
950     <table id="datetime-oztz-table">
951      <title>Australian Time Zone Abbreviations for Input</title>
952      <tgroup cols="3">
953       <thead>
954        <row>
955         <entry>Time Zone</entry>
956         <entry>Offset from UTC</entry>
957         <entry>Description</entry>
958        </row>
959       </thead>
960       <tbody>
961        <row>
962         <entry>ACST</entry>
963         <entry>+09:30</entry>
964         <entry>Central Australia Standard Time</entry>
965        </row>
966        <row>
967         <entry>CST</entry>
968         <entry>+10:30</entry>
969         <entry>Australian Central Standard Time</entry>
970        </row>
971        <row>
972         <entry>EST</entry>
973         <entry>+10:00</entry>
974         <entry>Australian Eastern Standard Time</entry>
975        </row>
976        <row>
977         <entry>SAT</entry>
978         <entry>+09:30</entry>
979         <entry>South Australian Standard Time</entry>
980        </row>
981       </tbody>
982      </tgroup>
983     </table>
984
985    <indexterm>
986     <primary>time zone</primary>
987     <secondary>configuration names</secondary>
988    </indexterm>
989
990    <para>
991     <xref linkend="datetime-timezone-set-table"> shows the time zone
992     names recognized by <productname>PostgreSQL</productname> as valid
993     settings for the <xref linkend="guc-timezone"> parameter, and as
994         parameters to the <literal>AT TIME ZONE function</> (see 
995         <xref linkend="functions-datetime-zoneconvert">).  Note that
996     these names are conceptually as well as practically different from
997     the names shown in <xref linkend="datetime-timezone-input-table">:
998     most of these names imply a local daylight-savings time rule, whereas
999     the former names each represent just a fixed offset from UTC.
1000    </para>
1001
1002    <para>
1003     In many cases there are several equivalent names for the same zone.
1004     These are listed on the same line.  The table is primarily sorted
1005     by the name of the principal city of the zone.
1006    </para>
1007
1008     <table id="datetime-timezone-set-table">
1009      <title>Time Zone Names for Setting <varname>timezone</> and <literal>AT TIME ZONE</></title>
1010      <tgroup cols="1">
1011       <thead>
1012        <row>
1013         <entry>Time Zone</entry>
1014        </row>
1015       </thead>
1016 <tbody>
1017  <row>
1018   <entry>Africa/Abidjan</entry>
1019  </row>
1020  <row>
1021   <entry>Africa/Accra</entry>
1022  </row>
1023  <row>
1024   <entry>Africa/Addis_Ababa</entry>
1025  </row>
1026  <row>
1027   <entry>Africa/Algiers</entry>
1028  </row>
1029  <row>
1030   <entry>Africa/Asmera</entry>
1031  </row>
1032  <row>
1033   <entry>Africa/Bamako</entry>
1034  </row>
1035  <row>
1036   <entry>Africa/Bangui</entry>
1037  </row>
1038  <row>
1039   <entry>Africa/Banjul</entry>
1040  </row>
1041  <row>
1042   <entry>Africa/Bissau</entry>
1043  </row>
1044  <row>
1045   <entry>Africa/Blantyre</entry>
1046  </row>
1047  <row>
1048   <entry>Africa/Brazzaville</entry>
1049  </row>
1050  <row>
1051   <entry>Africa/Bujumbura</entry>
1052  </row>
1053  <row>
1054   <entry>Africa/Cairo Egypt</entry>
1055  </row>
1056  <row>
1057   <entry>Africa/Casablanca</entry>
1058  </row>
1059  <row>
1060   <entry>Africa/Ceuta</entry>
1061  </row>
1062  <row>
1063   <entry>Africa/Conakry</entry>
1064  </row>
1065  <row>
1066   <entry>Africa/Dakar</entry>
1067  </row>
1068  <row>
1069   <entry>Africa/Dar_es_Salaam</entry>
1070  </row>
1071  <row>
1072   <entry>Africa/Djibouti</entry>
1073  </row>
1074  <row>
1075   <entry>Africa/Douala</entry>
1076  </row>
1077  <row>
1078   <entry>Africa/El_Aaiun</entry>
1079  </row>
1080  <row>
1081   <entry>Africa/Freetown</entry>
1082  </row>
1083  <row>
1084   <entry>Africa/Gaborone</entry>
1085  </row>
1086  <row>
1087   <entry>Africa/Harare</entry>
1088  </row>
1089  <row>
1090   <entry>Africa/Johannesburg</entry>
1091  </row>
1092  <row>
1093   <entry>Africa/Kampala</entry>
1094  </row>
1095  <row>
1096   <entry>Africa/Khartoum</entry>
1097  </row>
1098  <row>
1099   <entry>Africa/Kigali</entry>
1100  </row>
1101  <row>
1102   <entry>Africa/Kinshasa</entry>
1103  </row>
1104  <row>
1105   <entry>Africa/Lagos</entry>
1106  </row>
1107  <row>
1108   <entry>Africa/Libreville</entry>
1109  </row>
1110  <row>
1111   <entry>Africa/Lome</entry>
1112  </row>
1113  <row>
1114   <entry>Africa/Luanda</entry>
1115  </row>
1116  <row>
1117   <entry>Africa/Lubumbashi</entry>
1118  </row>
1119  <row>
1120   <entry>Africa/Lusaka</entry>
1121  </row>
1122  <row>
1123   <entry>Africa/Malabo</entry>
1124  </row>
1125  <row>
1126   <entry>Africa/Maputo</entry>
1127  </row>
1128  <row>
1129   <entry>Africa/Maseru</entry>
1130  </row>
1131  <row>
1132   <entry>Africa/Mbabane</entry>
1133  </row>
1134  <row>
1135   <entry>Africa/Mogadishu</entry>
1136  </row>
1137  <row>
1138   <entry>Africa/Monrovia</entry>
1139  </row>
1140  <row>
1141   <entry>Africa/Nairobi</entry>
1142  </row>
1143  <row>
1144   <entry>Africa/Ndjamena</entry>
1145  </row>
1146  <row>
1147   <entry>Africa/Niamey</entry>
1148  </row>
1149  <row>
1150   <entry>Africa/Nouakchott</entry>
1151  </row>
1152  <row>
1153   <entry>Africa/Ouagadougou</entry>
1154  </row>
1155  <row>
1156   <entry>Africa/Porto-Novo</entry>
1157  </row>
1158  <row>
1159   <entry>Africa/Sao_Tome</entry>
1160  </row>
1161  <row>
1162   <entry>Africa/Timbuktu</entry>
1163  </row>
1164  <row>
1165   <entry>Africa/Tripoli Libya</entry>
1166  </row>
1167  <row>
1168   <entry>Africa/Tunis</entry>
1169  </row>
1170  <row>
1171   <entry>Africa/Windhoek</entry>
1172  </row>
1173  <row>
1174   <entry>America/Adak America/Atka US/Aleutian</entry>
1175  </row>
1176  <row>
1177   <entry>America/Anchorage SystemV/YST9YDT US/Alaska</entry>
1178  </row>
1179  <row>
1180   <entry>America/Anguilla</entry>
1181  </row>
1182  <row>
1183   <entry>America/Antigua</entry>
1184  </row>
1185  <row>
1186   <entry>America/Araguaina</entry>
1187  </row>
1188  <row>
1189   <entry>America/Aruba</entry>
1190  </row>
1191  <row>
1192   <entry>America/Asuncion</entry>
1193  </row>
1194  <row>
1195   <entry>America/Bahia</entry>
1196  </row>
1197  <row>
1198   <entry>America/Barbados</entry>
1199  </row>
1200  <row>
1201   <entry>America/Belem</entry>
1202  </row>
1203  <row>
1204   <entry>America/Belize</entry>
1205  </row>
1206  <row>
1207   <entry>America/Boa_Vista</entry>
1208  </row>
1209  <row>
1210   <entry>America/Bogota</entry>
1211  </row>
1212  <row>
1213   <entry>America/Boise</entry>
1214  </row>
1215  <row>
1216   <entry>America/Buenos_Aires</entry>
1217  </row>
1218  <row>
1219   <entry>America/Cambridge_Bay</entry>
1220  </row>
1221  <row>
1222   <entry>America/Campo_Grande</entry>
1223  </row>
1224  <row>
1225   <entry>America/Cancun</entry>
1226  </row>
1227  <row>
1228   <entry>America/Caracas</entry>
1229  </row>
1230  <row>
1231   <entry>America/Catamarca</entry>
1232  </row>
1233  <row>
1234   <entry>America/Cayenne</entry>
1235  </row>
1236  <row>
1237   <entry>America/Cayman</entry>
1238  </row>
1239  <row>
1240   <entry>America/Chicago CST6CDT SystemV/CST6CDT US/Central</entry>
1241  </row>
1242  <row>
1243   <entry>America/Chihuahua</entry>
1244  </row>
1245  <row>
1246   <entry>America/Cordoba America/Rosario</entry>
1247  </row>
1248  <row>
1249   <entry>America/Costa_Rica</entry>
1250  </row>
1251  <row>
1252   <entry>America/Cuiaba</entry>
1253  </row>
1254  <row>
1255   <entry>America/Curacao</entry>
1256  </row>
1257  <row>
1258   <entry>America/Danmarkshavn</entry>
1259  </row>
1260  <row>
1261   <entry>America/Dawson</entry>
1262  </row>
1263  <row>
1264   <entry>America/Dawson_Creek</entry>
1265  </row>
1266  <row>
1267   <entry>America/Denver MST7MDT SystemV/MST7MDT US/Mountain America/Shiprock Navajo</entry>
1268  </row>
1269  <row>
1270   <entry>America/Detroit US/Michigan</entry>
1271  </row>
1272  <row>
1273   <entry>America/Dominica</entry>
1274  </row>
1275  <row>
1276   <entry>America/Edmonton Canada/Mountain</entry>
1277  </row>
1278  <row>
1279   <entry>America/Eirunepe</entry>
1280  </row>
1281  <row>
1282   <entry>America/El_Salvador</entry>
1283  </row>
1284  <row>
1285   <entry>America/Ensenada America/Tijuana Mexico/BajaNorte</entry>
1286  </row>
1287  <row>
1288   <entry>America/Fortaleza</entry>
1289  </row>
1290  <row>
1291   <entry>America/Glace_Bay</entry>
1292  </row>
1293  <row>
1294   <entry>America/Godthab</entry>
1295  </row>
1296  <row>
1297   <entry>America/Goose_Bay</entry>
1298  </row>
1299  <row>
1300   <entry>America/Grand_Turk</entry>
1301  </row>
1302  <row>
1303   <entry>America/Grenada</entry>
1304  </row>
1305  <row>
1306   <entry>America/Guadeloupe</entry>
1307  </row>
1308  <row>
1309   <entry>America/Guatemala</entry>
1310  </row>
1311  <row>
1312   <entry>America/Guayaquil</entry>
1313  </row>
1314  <row>
1315   <entry>America/Guyana</entry>
1316  </row>
1317  <row>
1318   <entry>America/Halifax Canada/Atlantic SystemV/AST4ADT</entry>
1319  </row>
1320  <row>
1321   <entry>America/Havana Cuba</entry>
1322  </row>
1323  <row>
1324   <entry>America/Hermosillo</entry>
1325  </row>
1326  <row>
1327   <entry>America/Indiana/Indianapolis America/Indianapolis America/Fort_Wayne EST SystemV/EST5 US/East-Indiana</entry>
1328  </row>
1329  <row>
1330   <entry>America/Indiana/Knox America/Knox_IN US/Indiana-Starke</entry>
1331  </row>
1332  <row>
1333   <entry>America/Indiana/Marengo</entry>
1334  </row>
1335  <row>
1336   <entry>America/Indiana/Vevay</entry>
1337  </row>
1338  <row>
1339   <entry>America/Inuvik</entry>
1340  </row>
1341  <row>
1342   <entry>America/Iqaluit</entry>
1343  </row>
1344  <row>
1345   <entry>America/Jamaica Jamaica</entry>
1346  </row>
1347  <row>
1348   <entry>America/Jujuy</entry>
1349  </row>
1350  <row>
1351   <entry>America/Juneau</entry>
1352  </row>
1353  <row>
1354   <entry>America/Kentucky/Louisville America/Louisville</entry>
1355  </row>
1356  <row>
1357   <entry>America/Kentucky/Monticello</entry>
1358  </row>
1359  <row>
1360   <entry>America/La_Paz</entry>
1361  </row>
1362  <row>
1363   <entry>America/Lima</entry>
1364  </row>
1365  <row>
1366   <entry>America/Los_Angeles PST8PDT SystemV/PST8PDT US/Pacific US/Pacific-New</entry>
1367  </row>
1368  <row>
1369   <entry>America/Maceio</entry>
1370  </row>
1371  <row>
1372   <entry>America/Managua</entry>
1373  </row>
1374  <row>
1375   <entry>America/Manaus Brazil/West</entry>
1376  </row>
1377  <row>
1378   <entry>America/Martinique</entry>
1379  </row>
1380  <row>
1381   <entry>America/Mazatlan Mexico/BajaSur</entry>
1382  </row>
1383  <row>
1384   <entry>America/Mendoza</entry>
1385  </row>
1386  <row>
1387   <entry>America/Menominee</entry>
1388  </row>
1389  <row>
1390   <entry>America/Merida</entry>
1391  </row>
1392  <row>
1393   <entry>America/Mexico_City Mexico/General</entry>
1394  </row>
1395  <row>
1396   <entry>America/Miquelon</entry>
1397  </row>
1398  <row>
1399   <entry>America/Monterrey</entry>
1400  </row>
1401  <row>
1402   <entry>America/Montevideo</entry>
1403  </row>
1404  <row>
1405   <entry>America/Montreal</entry>
1406  </row>
1407  <row>
1408   <entry>America/Montserrat</entry>
1409  </row>
1410  <row>
1411   <entry>America/Nassau</entry>
1412  </row>
1413  <row>
1414   <entry>America/New_York EST5EDT SystemV/EST5EDT US/Eastern</entry>
1415  </row>
1416  <row>
1417   <entry>America/Nipigon</entry>
1418  </row>
1419  <row>
1420   <entry>America/Nome</entry>
1421  </row>
1422  <row>
1423   <entry>America/Noronha Brazil/DeNoronha</entry>
1424  </row>
1425  <row>
1426   <entry>America/North_Dakota/Center</entry>
1427  </row>
1428  <row>
1429   <entry>America/Panama</entry>
1430  </row>
1431  <row>
1432   <entry>America/Pangnirtung</entry>
1433  </row>
1434  <row>
1435   <entry>America/Paramaribo</entry>
1436  </row>
1437  <row>
1438   <entry>America/Phoenix MST SystemV/MST7 US/Arizona</entry>
1439  </row>
1440  <row>
1441   <entry>America/Port-au-Prince</entry>
1442  </row>
1443  <row>
1444   <entry>America/Port_of_Spain</entry>
1445  </row>
1446  <row>
1447   <entry>America/Porto_Acre America/Rio_Branco Brazil/Acre</entry>
1448  </row>
1449  <row>
1450   <entry>America/Porto_Velho</entry>
1451  </row>
1452  <row>
1453   <entry>America/Puerto_Rico SystemV/AST4</entry>
1454  </row>
1455  <row>
1456   <entry>America/Rainy_River</entry>
1457  </row>
1458  <row>
1459   <entry>America/Rankin_Inlet</entry>
1460  </row>
1461  <row>
1462   <entry>America/Recife</entry>
1463  </row>
1464  <row>
1465   <entry>America/Regina Canada/East-Saskatchewan Canada/Saskatchewan SystemV/CST6</entry>
1466  </row>
1467  <row>
1468   <entry>America/Santiago Chile/Continental</entry>
1469  </row>
1470  <row>
1471   <entry>America/Santo_Domingo</entry>
1472  </row>
1473  <row>
1474   <entry>America/Sao_Paulo Brazil/East</entry>
1475  </row>
1476  <row>
1477   <entry>America/Scoresbysund</entry>
1478  </row>
1479  <row>
1480   <entry>America/St_Johns Canada/Newfoundland</entry>
1481  </row>
1482  <row>
1483   <entry>America/St_Kitts</entry>
1484  </row>
1485  <row>
1486   <entry>America/St_Lucia</entry>
1487  </row>
1488  <row>
1489   <entry>America/St_Thomas America/Virgin</entry>
1490  </row>
1491  <row>
1492   <entry>America/St_Vincent</entry>
1493  </row>
1494  <row>
1495   <entry>America/Swift_Current</entry>
1496  </row>
1497  <row>
1498   <entry>America/Tegucigalpa</entry>
1499  </row>
1500  <row>
1501   <entry>America/Thule</entry>
1502  </row>
1503  <row>
1504   <entry>America/Thunder_Bay</entry>
1505  </row>
1506  <row>
1507   <entry>America/Toronto Canada/Eastern</entry>
1508  </row>
1509  <row>
1510   <entry>America/Tortola</entry>
1511  </row>
1512  <row>
1513   <entry>America/Vancouver Canada/Pacific</entry>
1514  </row>
1515  <row>
1516   <entry>America/Whitehorse Canada/Yukon</entry>
1517  </row>
1518  <row>
1519   <entry>America/Winnipeg Canada/Central</entry>
1520  </row>
1521  <row>
1522   <entry>America/Yakutat</entry>
1523  </row>
1524  <row>
1525   <entry>America/Yellowknife</entry>
1526  </row>
1527  <row>
1528   <entry>Antarctica/Casey</entry>
1529  </row>
1530  <row>
1531   <entry>Antarctica/Davis</entry>
1532  </row>
1533  <row>
1534   <entry>Antarctica/DumontDUrville</entry>
1535  </row>
1536  <row>
1537   <entry>Antarctica/Mawson</entry>
1538  </row>
1539  <row>
1540   <entry>Antarctica/McMurdo Antarctica/South_Pole</entry>
1541  </row>
1542  <row>
1543   <entry>Antarctica/Palmer</entry>
1544  </row>
1545  <row>
1546   <entry>Antarctica/Rothera</entry>
1547  </row>
1548  <row>
1549   <entry>Antarctica/Syowa</entry>
1550  </row>
1551  <row>
1552   <entry>Antarctica/Vostok</entry>
1553  </row>
1554  <row>
1555   <entry>Asia/Aden</entry>
1556  </row>
1557  <row>
1558   <entry>Asia/Almaty</entry>
1559  </row>
1560  <row>
1561   <entry>Asia/Amman</entry>
1562  </row>
1563  <row>
1564   <entry>Asia/Anadyr</entry>
1565  </row>
1566  <row>
1567   <entry>Asia/Aqtau</entry>
1568  </row>
1569  <row>
1570   <entry>Asia/Aqtobe</entry>
1571  </row>
1572  <row>
1573   <entry>Asia/Ashgabat Asia/Ashkhabad</entry>
1574  </row>
1575  <row>
1576   <entry>Asia/Baghdad</entry>
1577  </row>
1578  <row>
1579   <entry>Asia/Bahrain</entry>
1580  </row>
1581  <row>
1582   <entry>Asia/Baku</entry>
1583  </row>
1584  <row>
1585   <entry>Asia/Bangkok</entry>
1586  </row>
1587  <row>
1588   <entry>Asia/Beirut</entry>
1589  </row>
1590  <row>
1591   <entry>Asia/Bishkek</entry>
1592  </row>
1593  <row>
1594   <entry>Asia/Brunei</entry>
1595  </row>
1596  <row>
1597   <entry>Asia/Calcutta</entry>
1598  </row>
1599  <row>
1600   <entry>Asia/Choibalsan</entry>
1601  </row>
1602  <row>
1603   <entry>Asia/Chongqing Asia/Chungking</entry>
1604  </row>
1605  <row>
1606   <entry>Asia/Colombo</entry>
1607  </row>
1608  <row>
1609   <entry>Asia/Dacca Asia/Dhaka</entry>
1610  </row>
1611  <row>
1612   <entry>Asia/Damascus</entry>
1613  </row>
1614  <row>
1615   <entry>Asia/Dili</entry>
1616  </row>
1617  <row>
1618   <entry>Asia/Dubai</entry>
1619  </row>
1620  <row>
1621   <entry>Asia/Dushanbe</entry>
1622  </row>
1623  <row>
1624   <entry>Asia/Gaza</entry>
1625  </row>
1626  <row>
1627   <entry>Asia/Harbin</entry>
1628  </row>
1629  <row>
1630   <entry>Asia/Hong_Kong Hongkong</entry>
1631  </row>
1632  <row>
1633   <entry>Asia/Hovd</entry>
1634  </row>
1635  <row>
1636   <entry>Asia/Irkutsk</entry>
1637  </row>
1638  <row>
1639   <entry>Asia/Jakarta</entry>
1640  </row>
1641  <row>
1642   <entry>Asia/Jayapura</entry>
1643  </row>
1644  <row>
1645   <entry>Asia/Jerusalem Asia/Tel_Aviv Israel</entry>
1646  </row>
1647  <row>
1648   <entry>Asia/Kabul</entry>
1649  </row>
1650  <row>
1651   <entry>Asia/Kamchatka</entry>
1652  </row>
1653  <row>
1654   <entry>Asia/Karachi</entry>
1655  </row>
1656  <row>
1657   <entry>Asia/Kashgar</entry>
1658  </row>
1659  <row>
1660   <entry>Asia/Katmandu</entry>
1661  </row>
1662  <row>
1663   <entry>Asia/Krasnoyarsk</entry>
1664  </row>
1665  <row>
1666   <entry>Asia/Kuala_Lumpur</entry>
1667  </row>
1668  <row>
1669   <entry>Asia/Kuching</entry>
1670  </row>
1671  <row>
1672   <entry>Asia/Kuwait</entry>
1673  </row>
1674  <row>
1675   <entry>Asia/Macao Asia/Macau</entry>
1676  </row>
1677  <row>
1678   <entry>Asia/Magadan</entry>
1679  </row>
1680  <row>
1681   <entry>Asia/Makassar Asia/Ujung_Pandang</entry>
1682  </row>
1683  <row>
1684   <entry>Asia/Manila</entry>
1685  </row>
1686  <row>
1687   <entry>Asia/Muscat</entry>
1688  </row>
1689  <row>
1690   <entry>Asia/Nicosia Europe/Nicosia</entry>
1691  </row>
1692  <row>
1693   <entry>Asia/Novosibirsk</entry>
1694  </row>
1695  <row>
1696   <entry>Asia/Omsk</entry>
1697  </row>
1698  <row>
1699   <entry>Asia/Oral</entry>
1700  </row>
1701  <row>
1702   <entry>Asia/Phnom_Penh</entry>
1703  </row>
1704  <row>
1705   <entry>Asia/Pontianak</entry>
1706  </row>
1707  <row>
1708   <entry>Asia/Pyongyang</entry>
1709  </row>
1710  <row>
1711   <entry>Asia/Qatar</entry>
1712  </row>
1713  <row>
1714   <entry>Asia/Qyzylorda</entry>
1715  </row>
1716  <row>
1717   <entry>Asia/Rangoon</entry>
1718  </row>
1719  <row>
1720   <entry>Asia/Riyadh</entry>
1721  </row>
1722  <row>
1723   <entry>Asia/Riyadh87 Mideast/Riyadh87</entry>
1724  </row>
1725  <row>
1726   <entry>Asia/Riyadh88 Mideast/Riyadh88</entry>
1727  </row>
1728  <row>
1729   <entry>Asia/Riyadh89 Mideast/Riyadh89</entry>
1730  </row>
1731  <row>
1732   <entry>Asia/Saigon</entry>
1733  </row>
1734  <row>
1735   <entry>Asia/Sakhalin</entry>
1736  </row>
1737  <row>
1738   <entry>Asia/Samarkand</entry>
1739  </row>
1740  <row>
1741   <entry>Asia/Seoul ROK</entry>
1742  </row>
1743  <row>
1744   <entry>Asia/Shanghai PRC</entry>
1745  </row>
1746  <row>
1747   <entry>Asia/Singapore Singapore</entry>
1748  </row>
1749  <row>
1750   <entry>Asia/Taipei ROC</entry>
1751  </row>
1752  <row>
1753   <entry>Asia/Tashkent</entry>
1754  </row>
1755  <row>
1756   <entry>Asia/Tbilisi</entry>
1757  </row>
1758  <row>
1759   <entry>Asia/Tehran Iran</entry>
1760  </row>
1761  <row>
1762   <entry>Asia/Thimbu Asia/Thimphu</entry>
1763  </row>
1764  <row>
1765   <entry>Asia/Tokyo Japan</entry>
1766  </row>
1767  <row>
1768   <entry>Asia/Ulaanbaatar Asia/Ulan_Bator</entry>
1769  </row>
1770  <row>
1771   <entry>Asia/Urumqi</entry>
1772  </row>
1773  <row>
1774   <entry>Asia/Vientiane</entry>
1775  </row>
1776  <row>
1777   <entry>Asia/Vladivostok</entry>
1778  </row>
1779  <row>
1780   <entry>Asia/Yakutsk</entry>
1781  </row>
1782  <row>
1783   <entry>Asia/Yekaterinburg</entry>
1784  </row>
1785  <row>
1786   <entry>Asia/Yerevan</entry>
1787  </row>
1788  <row>
1789   <entry>Atlantic/Azores</entry>
1790  </row>
1791  <row>
1792   <entry>Atlantic/Bermuda</entry>
1793  </row>
1794  <row>
1795   <entry>Atlantic/Canary</entry>
1796  </row>
1797  <row>
1798   <entry>Atlantic/Cape_Verde</entry>
1799  </row>
1800  <row>
1801   <entry>Atlantic/Faeroe</entry>
1802  </row>
1803  <row>
1804   <entry>Atlantic/Madeira</entry>
1805  </row>
1806  <row>
1807   <entry>Atlantic/Reykjavik Iceland</entry>
1808  </row>
1809  <row>
1810   <entry>Atlantic/South_Georgia</entry>
1811  </row>
1812  <row>
1813   <entry>Atlantic/St_Helena</entry>
1814  </row>
1815  <row>
1816   <entry>Atlantic/Stanley</entry>
1817  </row>
1818  <row>
1819   <entry>Australia/ACT Australia/Canberra Australia/NSW Australia/Sydney</entry>
1820  </row>
1821  <row>
1822   <entry>Australia/Adelaide Australia/South</entry>
1823  </row>
1824  <row>
1825   <entry>Australia/Brisbane Australia/Queensland</entry>
1826  </row>
1827  <row>
1828   <entry>Australia/Broken_Hill Australia/Yancowinna</entry>
1829  </row>
1830  <row>
1831   <entry>Australia/Darwin Australia/North</entry>
1832  </row>
1833  <row>
1834   <entry>Australia/Hobart Australia/Tasmania</entry>
1835  </row>
1836  <row>
1837   <entry>Australia/LHI Australia/Lord_Howe</entry>
1838  </row>
1839  <row>
1840   <entry>Australia/Lindeman</entry>
1841  </row>
1842  <row>
1843   <entry>Australia/Melbourne Australia/Victoria</entry>
1844  </row>
1845  <row>
1846   <entry>Australia/Perth Australia/West</entry>
1847  </row>
1848  <row>
1849   <entry>CET</entry>
1850  </row>
1851  <row>
1852   <entry>EET</entry>
1853  </row>
1854  <row>
1855   <entry>Etc/GMT+1</entry>
1856  </row>
1857  <row>
1858   <entry>Etc/GMT+2</entry>
1859  </row>
1860  <row>
1861   <entry>Etc/GMT+3</entry>
1862  </row>
1863  <row>
1864   <entry>Etc/GMT+4</entry>
1865  </row>
1866  <row>
1867   <entry>Etc/GMT+5</entry>
1868  </row>
1869  <row>
1870   <entry>Etc/GMT+6</entry>
1871  </row>
1872  <row>
1873   <entry>Etc/GMT+7</entry>
1874  </row>
1875  <row>
1876   <entry>Etc/GMT+8</entry>
1877  </row>
1878  <row>
1879   <entry>Etc/GMT+9</entry>
1880  </row>
1881  <row>
1882   <entry>Etc/GMT+10</entry>
1883  </row>
1884  <row>
1885   <entry>Etc/GMT+11</entry>
1886  </row>
1887  <row>
1888   <entry>Etc/GMT+12</entry>
1889  </row>
1890  <row>
1891   <entry>Etc/GMT-1</entry>
1892  </row>
1893  <row>
1894   <entry>Etc/GMT-2</entry>
1895  </row>
1896  <row>
1897   <entry>Etc/GMT-3</entry>
1898  </row>
1899  <row>
1900   <entry>Etc/GMT-4</entry>
1901  </row>
1902  <row>
1903   <entry>Etc/GMT-5</entry>
1904  </row>
1905  <row>
1906   <entry>Etc/GMT-6</entry>
1907  </row>
1908  <row>
1909   <entry>Etc/GMT-7</entry>
1910  </row>
1911  <row>
1912   <entry>Etc/GMT-8</entry>
1913  </row>
1914  <row>
1915   <entry>Etc/GMT-9</entry>
1916  </row>
1917  <row>
1918   <entry>Etc/GMT-10</entry>
1919  </row>
1920  <row>
1921   <entry>Etc/GMT-11</entry>
1922  </row>
1923  <row>
1924   <entry>Etc/GMT-12</entry>
1925  </row>
1926  <row>
1927   <entry>Etc/GMT-13</entry>
1928  </row>
1929  <row>
1930   <entry>Etc/GMT-14</entry>
1931  </row>
1932  <row>
1933   <entry>Europe/Amsterdam</entry>
1934  </row>
1935  <row>
1936   <entry>Europe/Andorra</entry>
1937  </row>
1938  <row>
1939   <entry>Europe/Athens</entry>
1940  </row>
1941  <row>
1942   <entry>Europe/Belfast</entry>
1943  </row>
1944  <row>
1945   <entry>Europe/Belgrade Europe/Ljubljana Europe/Sarajevo Europe/Skopje Europe/Zagreb</entry>
1946  </row>
1947  <row>
1948   <entry>Europe/Berlin</entry>
1949  </row>
1950  <row>
1951   <entry>Europe/Brussels</entry>
1952  </row>
1953  <row>
1954   <entry>Europe/Bucharest</entry>
1955  </row>
1956  <row>
1957   <entry>Europe/Budapest</entry>
1958  </row>
1959  <row>
1960   <entry>Europe/Chisinau Europe/Tiraspol</entry>
1961  </row>
1962  <row>
1963   <entry>Europe/Copenhagen</entry>
1964  </row>
1965  <row>
1966   <entry>Europe/Dublin Eire</entry>
1967  </row>
1968  <row>
1969   <entry>Europe/Gibraltar</entry>
1970  </row>
1971  <row>
1972   <entry>Europe/Helsinki</entry>
1973  </row>
1974  <row>
1975   <entry>Europe/Istanbul Asia/Istanbul Turkey</entry>
1976  </row>
1977  <row>
1978   <entry>Europe/Kaliningrad</entry>
1979  </row>
1980  <row>
1981   <entry>Europe/Kiev</entry>
1982  </row>
1983  <row>
1984   <entry>Europe/Lisbon Portugal</entry>
1985  </row>
1986  <row>
1987   <entry>Europe/London GB GB-Eire</entry>
1988  </row>
1989  <row>
1990   <entry>Europe/Luxembourg</entry>
1991  </row>
1992  <row>
1993   <entry>Europe/Madrid</entry>
1994  </row>
1995  <row>
1996   <entry>Europe/Malta</entry>
1997  </row>
1998  <row>
1999   <entry>Europe/Minsk</entry>
2000  </row>
2001  <row>
2002   <entry>Europe/Monaco</entry>
2003  </row>
2004  <row>
2005   <entry>Europe/Moscow W-SU</entry>
2006  </row>
2007  <row>
2008   <entry>Europe/Oslo Arctic/Longyearbyen Atlantic/Jan_Mayen</entry>
2009  </row>
2010  <row>
2011   <entry>Europe/Paris</entry>
2012  </row>
2013  <row>
2014   <entry>Europe/Prague Europe/Bratislava</entry>
2015  </row>
2016  <row>
2017   <entry>Europe/Riga</entry>
2018  </row>
2019  <row>
2020   <entry>Europe/Rome Europe/San_Marino Europe/Vatican</entry>
2021  </row>
2022  <row>
2023   <entry>Europe/Samara</entry>
2024  </row>
2025  <row>
2026   <entry>Europe/Simferopol</entry>
2027  </row>
2028  <row>
2029   <entry>Europe/Sofia</entry>
2030  </row>
2031  <row>
2032   <entry>Europe/Stockholm</entry>
2033  </row>
2034  <row>
2035   <entry>Europe/Tallinn</entry>
2036  </row>
2037  <row>
2038   <entry>Europe/Tirane</entry>
2039  </row>
2040  <row>
2041   <entry>Europe/Uzhgorod</entry>
2042  </row>
2043  <row>
2044   <entry>Europe/Vaduz</entry>
2045  </row>
2046  <row>
2047   <entry>Europe/Vienna</entry>
2048  </row>
2049  <row>
2050   <entry>Europe/Vilnius</entry>
2051  </row>
2052  <row>
2053   <entry>Europe/Warsaw Poland</entry>
2054  </row>
2055  <row>
2056   <entry>Europe/Zaporozhye</entry>
2057  </row>
2058  <row>
2059   <entry>Europe/Zurich</entry>
2060  </row>
2061  <row>
2062   <entry>Factory</entry>
2063  </row>
2064  <row>
2065   <entry>GMT GMT+0 GMT-0 GMT0 Greenwich Etc/GMT Etc/GMT+0 Etc/GMT-0 Etc/GMT0 Etc/Greenwich</entry>
2066  </row>
2067  <row>
2068   <entry>Indian/Antananarivo</entry>
2069  </row>
2070  <row>
2071   <entry>Indian/Chagos</entry>
2072  </row>
2073  <row>
2074   <entry>Indian/Christmas</entry>
2075  </row>
2076  <row>
2077   <entry>Indian/Cocos</entry>
2078  </row>
2079  <row>
2080   <entry>Indian/Comoro</entry>
2081  </row>
2082  <row>
2083   <entry>Indian/Kerguelen</entry>
2084  </row>
2085  <row>
2086   <entry>Indian/Mahe</entry>
2087  </row>
2088  <row>
2089   <entry>Indian/Maldives</entry>
2090  </row>
2091  <row>
2092   <entry>Indian/Mauritius</entry>
2093  </row>
2094  <row>
2095   <entry>Indian/Mayotte</entry>
2096  </row>
2097  <row>
2098   <entry>Indian/Reunion</entry>
2099  </row>
2100  <row>
2101   <entry>MET</entry>
2102  </row>
2103  <row>
2104   <entry>Pacific/Apia</entry>
2105  </row>
2106  <row>
2107   <entry>Pacific/Auckland NZ</entry>
2108  </row>
2109  <row>
2110   <entry>Pacific/Chatham NZ-CHAT</entry>
2111  </row>
2112  <row>
2113   <entry>Pacific/Easter Chile/EasterIsland</entry>
2114  </row>
2115  <row>
2116   <entry>Pacific/Efate</entry>
2117  </row>
2118  <row>
2119   <entry>Pacific/Enderbury</entry>
2120  </row>
2121  <row>
2122   <entry>Pacific/Fakaofo</entry>
2123  </row>
2124  <row>
2125   <entry>Pacific/Fiji</entry>
2126  </row>
2127  <row>
2128   <entry>Pacific/Funafuti</entry>
2129  </row>
2130  <row>
2131   <entry>Pacific/Galapagos</entry>
2132  </row>
2133  <row>
2134   <entry>Pacific/Gambier SystemV/YST9</entry>
2135  </row>
2136  <row>
2137   <entry>Pacific/Guadalcanal</entry>
2138  </row>
2139  <row>
2140   <entry>Pacific/Guam</entry>
2141  </row>
2142  <row>
2143   <entry>Pacific/Honolulu HST SystemV/HST10 US/Hawaii</entry>
2144  </row>
2145  <row>
2146   <entry>Pacific/Johnston</entry>
2147  </row>
2148  <row>
2149   <entry>Pacific/Kiritimati</entry>
2150  </row>
2151  <row>
2152   <entry>Pacific/Kosrae</entry>
2153  </row>
2154  <row>
2155   <entry>Pacific/Kwajalein Kwajalein</entry>
2156  </row>
2157  <row>
2158   <entry>Pacific/Majuro</entry>
2159  </row>
2160  <row>
2161   <entry>Pacific/Marquesas</entry>
2162  </row>
2163  <row>
2164   <entry>Pacific/Midway</entry>
2165  </row>
2166  <row>
2167   <entry>Pacific/Nauru</entry>
2168  </row>
2169  <row>
2170   <entry>Pacific/Niue</entry>
2171  </row>
2172  <row>
2173   <entry>Pacific/Norfolk</entry>
2174  </row>
2175  <row>
2176   <entry>Pacific/Noumea</entry>
2177  </row>
2178  <row>
2179   <entry>Pacific/Pago_Pago Pacific/Samoa US/Samoa</entry>
2180  </row>
2181  <row>
2182   <entry>Pacific/Palau</entry>
2183  </row>
2184  <row>
2185   <entry>Pacific/Pitcairn SystemV/PST8</entry>
2186  </row>
2187  <row>
2188   <entry>Pacific/Ponape</entry>
2189  </row>
2190  <row>
2191   <entry>Pacific/Port_Moresby</entry>
2192  </row>
2193  <row>
2194   <entry>Pacific/Rarotonga</entry>
2195  </row>
2196  <row>
2197   <entry>Pacific/Saipan</entry>
2198  </row>
2199  <row>
2200   <entry>Pacific/Tahiti</entry>
2201  </row>
2202  <row>
2203   <entry>Pacific/Tarawa</entry>
2204  </row>
2205  <row>
2206   <entry>Pacific/Tongatapu</entry>
2207  </row>
2208  <row>
2209   <entry>Pacific/Truk</entry>
2210  </row>
2211  <row>
2212   <entry>Pacific/Wake</entry>
2213  </row>
2214  <row>
2215   <entry>Pacific/Wallis</entry>
2216  </row>
2217  <row>
2218   <entry>Pacific/Yap</entry>
2219  </row>
2220  <row>
2221   <entry>UCT Etc/UCT</entry>
2222  </row>
2223  <row>
2224   <entry>UTC Universal Zulu Etc/UTC Etc/Universal Etc/Zulu</entry>
2225  </row>
2226  <row>
2227   <entry>WET</entry>
2228  </row>
2229 </tbody>
2230      </tgroup>
2231     </table>
2232
2233    <para>
2234     In addition to the names listed in the table,
2235     <productname>PostgreSQL</productname> will accept time zone names of the
2236     form <replaceable>STD</><replaceable>offset</> or
2237     <replaceable>STD</><replaceable>offset</><replaceable>DST</>, where
2238     <replaceable>STD</> is a zone abbreviation, <replaceable>offset</> is a
2239     numeric offset in hours west from UTC, and <replaceable>DST</> is an
2240     optional daylight-savings zone abbreviation, assumed to stand for one hour
2241     ahead of the given offset.  For example, if <literal>EST5EDT</> were not
2242     already a recognized zone name, it would be accepted and would be
2243     functionally equivalent to USA East Coast time.  When a daylight-savings
2244     zone name is present, it is assumed to be used according to USA time zone
2245     rules, so this feature is of limited use outside North America.
2246     One should also be wary that this provision can lead to
2247     silently accepting bogus input, since there is no check on the
2248     reasonableness of the zone abbreviations.  For example,
2249     <literal>SET TIMEZONE TO FOOBAR0</> will work, leaving the system
2250     effectively using a rather peculiar abbreviation for GMT.
2251    </para>
2252
2253   </sect1>
2254
2255   <sect1 id="datetime-units-history">
2256   <title>History of Units</title>
2257
2258   <para>
2259    The Julian Date was invented by the French scholar
2260    Joseph Justus Scaliger (1540-1609)
2261    and probably takes its name from Scaliger's father,
2262    the Italian scholar Julius Caesar Scaliger (1484-1558).
2263    Astronomers have used the Julian period to assign a unique number to
2264    every day since 1 January 4713 BC. This is the so-called Julian Date
2265    (JD). JD 0 designates the 24 hours from noon UTC on 1 January 4713 BC
2266    to noon UTC on 2 January 4713 BC.
2267   </para>
2268
2269    <para>
2270    The <quote>Julian Date</quote> is different from the <quote>Julian
2271    Calendar</quote>.  The Julian calendar
2272    was introduced by Julius Caesar in 45 BC. It was in common use
2273    until the year 1582, when countries started changing to the Gregorian
2274    calendar.  In the Julian calendar, the tropical year is
2275    approximated as 365 1/4 days = 365.25 days. This gives an error of
2276    about 1 day in 128 years.
2277   </para>
2278
2279   <para>   
2280    The accumulating calendar error prompted
2281    Pope Gregory XIII to reform the calendar in accordance with
2282    instructions from the Council of Trent.
2283    In the Gregorian calendar, the tropical year is approximated as
2284    365 + 97 / 400 days = 365.2425 days. Thus it takes approximately 3300
2285    years for the tropical year to shift one day with respect to the
2286    Gregorian calendar.
2287   </para>
2288
2289   <para>
2290    The approximation 365+97/400 is achieved by having 97 leap years
2291    every 400 years, using the following rules:
2292
2293    <simplelist>
2294     <member>
2295      Every year divisible by 4 is a leap year.
2296     </member>
2297     <member>
2298      However, every year divisible by 100 is not a leap year.
2299     </member>
2300     <member>
2301      However, every year divisible by 400 is a leap year after all.
2302     </member>
2303    </simplelist>
2304
2305    So, 1700, 1800, 1900, 2100, and 2200 are not leap years. But 1600,
2306    2000, and 2400 are leap years.
2307
2308    By contrast, in the older Julian calendar all years divisible by 4 are leap
2309    years.
2310   </para>
2311
2312   <para>
2313    The papal bull of February 1582 decreed that 10 days should be dropped
2314    from October 1582 so that 15 October should follow immediately after
2315    4 October.
2316    This was observed in Italy, Poland, Portugal, and Spain. Other Catholic
2317    countries followed shortly after, but Protestant countries were
2318    reluctant to change, and the Greek orthodox countries didn't change
2319    until the start of the 20th century.
2320
2321    The reform was observed by Great Britain and Dominions (including what is
2322    now the USA) in 1752.
2323    Thus 2 September 1752 was followed by 14 September 1752.
2324
2325    This is why Unix systems have the <command>cal</command> program
2326    produce the following:
2327
2328 <screen>
2329 $ <userinput>cal 9 1752</userinput>
2330    September 1752
2331  S  M Tu  W Th  F  S
2332        1  2 14 15 16
2333 17 18 19 20 21 22 23
2334 24 25 26 27 28 29 30
2335 </screen>
2336   </para>
2337
2338    <note>
2339     <para>
2340      The SQL standard states that <quote>Within the definition of a
2341      <quote>datetime literal</quote>, the <quote>datetime
2342      value</quote>s are constrained by the natural rules for dates and
2343      times according to the Gregorian calendar</quote>.  Dates between
2344      1752-09-03 and 1752-09-13, although eliminated in some countries
2345      by Papal fiat, conform to <quote>natural rules</quote> and are
2346      hence valid dates.
2347     </para>
2348    </note>
2349
2350   <para>
2351    Different calendars have been developed in various parts of the
2352    world, many predating the Gregorian system.
2353
2354    For example,
2355    the beginnings of the Chinese calendar can be traced back to the 14th
2356    century BC. Legend has it that the Emperor Huangdi invented the
2357    calendar in 2637 BC.
2358    
2359    The People's Republic of China uses the Gregorian calendar
2360    for civil purposes. The Chinese calendar is used for determining
2361    festivals.
2362   </para>
2363  </sect1>
2364 </appendix>
2365
2366 <!-- Keep this comment at the end of the file
2367 Local variables:
2368 mode:sgml
2369 sgml-omittag:nil
2370 sgml-shorttag:t
2371 sgml-minimize-attributes:nil
2372 sgml-always-quote-attributes:t
2373 sgml-indent-step:1
2374 sgml-indent-data:t
2375 sgml-parent-document:nil
2376 sgml-default-dtd-file:"./reference.ced"
2377 sgml-exposed-tags:nil
2378 sgml-local-catalogs:("/usr/lib/sgml/catalog")
2379 sgml-local-ecat-files:nil
2380 End:
2381 -->