diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 1a8dcadda4..e6ff993b10 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -1255,270 +1255,15 @@ the time zone becomes GMT (on most systems anyway).
- ACSST
- +10:30
- Central Australia Summer Std Time
-
-
- ACST
- +09:30
- Central Australia Std Time
-
-
- ADT
- -02:00
- Atlantic Daylight Time
-
-
- AESST
- +11:00
- Australia Eastern Summer Std Time
-
-
- AEST
- +10:00
- Australia Eastern Std Time
-
-
- AHST
- -10:00
- Alaska-Hawaii Std Time
-
-
- AST
- -4:00
- Atlantic Std Time (Canada)
-
-
- AWSST
- +9:00
- Australia Western Summer Std Time
-
-
- AWST
- +8:00
- Australia Western Std Time
-
-
- BST
- +1:00
- British Summer Time
-
-
- BT
- +3:00
- Baghdad Time
-
-
- CADT
- +10:30
- Central Australia Daylight Savings Time
-
-
- CAST
- +09:30
- Central Australia Std Time
-
-
- CAT
- -10:00
- Central Alaska Time
-
-
- CCT
- +8:00
- China Coastal Time
-
-
- CDT
- -5:00
- Central Daylight Time
-
-
- CET
- +1:00
- Central European Time
-
-
- CETDST
- +2:00
- Central European Daylight Savings Time
-
-
- CST
- +6:00
- Central Std Time
-
-
- DNT
- +1:00
- Dansk Normal Tid
-
-
- DST
- +1:00
- Dansk Standard Time (?)
-
-
- EAST
- +10:00
- East Australian Std Time
-
-
- EDT
- -4:00
- Eastern Daylight Time
-
-
- EET
- +2:00
- Eastern Europe, USSR Zone 1
-
-
- EETDST
- +3:00
- Eastern Europe Daylight Savings Time
-
-
- EST
- -5:00
- Eastern Standard Time
-
-
- FST
- +1:00
- French Summer Time
-
-
- FWT
- +2:00
- French Winter Time
-
-
- GMT
- 0:00
- Greenwish Mean Time
-
-
- GST
- +10:00
- Guam Std Time, USSR Zone 9
-
-
- HDT
- -9:00
- Hawaii/Alaska
+ NZDT
+ +13:00
+ New Zealand Daylight Time
IDLE
+12:00
International Date Line, East
-
- IDLW
- -12:00
- International Date Line, West
-
-
- IST
- +2:00
- Israel
-
-
- IT
- +3:40
- Iran Time
-
-
- JST
- +9:00
- Japan Std Time,USSR Zone 8
-
-
- JT
- +7:30
- Java Time
-
-
- KST
- +9:00
- Korea Standard Time
-
-
- LIGT
- +10:00
- Melbourne, Australia
-
-
- MDT
- -6:00
- Mountain Daylight Time
-
-
- MEST
- +2:00
- Middle Europe Summer Time
-
-
- MET
- +1:00
- Middle Europe Time
-
-
- METDST
- +2:00
- Middle Europe Daylight Time
-
-
- MEWT
- +1:00
- Middle Europe Winter Time
-
-
- MEZ
- +1:00
- Middle Europe Zone
-
-
- MST
- -7:00
- Mountain Standard Time
-
-
- MT
- +8:30
- Moluccas Time
-
-
- NDT
- -2:30
- Newfoundland Daylight Time
-
-
- NFT
- -3:30
- Newfoundland Standard Time
-
-
- NOR
- +1:00
- Norway Standard Time
-
-
- NST
- -3:30
- Newfoundland Standard Time
-
-
- NT
- -11:00
- Nome Time
-
-
- NZDT
- +13:00
- New Zealand Daylight Time
-
NZST
+12:00
@@ -1529,6 +1274,311 @@ the time zone becomes GMT (on most systems anyway).
+12:00
New Zealand Time
+
+ AESST
+ +11:00
+ Australia Eastern Summer Std Time
+
+
+ ACSST
+ +10:30
+ Central Australia Summer Std Time
+
+
+ CADT
+ +10:30
+ Central Australia Daylight Savings Time
+
+
+ SADT
+ +10:30
+ South Australian Daylight Time
+
+
+ AEST
+ +10:00
+ Australia Eastern Std Time
+
+
+ EAST
+ +10:00
+ East Australian Std Time
+
+
+ GST
+ +10:00
+ Guam Std Time, USSR Zone 9
+
+
+ LIGT
+ +10:00
+ Melbourne, Australia
+
+
+ ACST
+ +09:30
+ Central Australia Std Time
+
+
+ CAST
+ +09:30
+ Central Australia Std Time
+
+
+ SAT
+ +9:30
+ South Australian Std Time
+
+
+ AWSST
+ +9:00
+ Australia Western Summer Std Time
+
+
+ JST
+ +9:00
+ Japan Std Time,USSR Zone 8
+
+
+ KST
+ +9:00
+ Korea Standard Time
+
+
+ WDT
+ +9:00
+ West Australian Daylight Time
+
+
+ MT
+ +8:30
+ Moluccas Time
+
+
+ AWST
+ +8:00
+ Australia Western Std Time
+
+
+ CCT
+ +8:00
+ China Coastal Time
+
+
+ WADT
+ +8:00
+ West Australian Daylight Time
+
+
+ WST
+ +8:00
+ West Australian Std Time
+
+
+ JT
+ +7:30
+ Java Time
+
+
+ WAST
+ +7:00
+ West Australian Std Time
+
+
+ IT
+ +3:30
+ Iran Time
+
+
+ BT
+ +3:00
+ Baghdad Time
+
+
+ EETDST
+ +3:00
+ Eastern Europe Daylight Savings Time
+
+
+ CETDST
+ +2:00
+ Central European Daylight Savings Time
+
+
+ EET
+ +2:00
+ Eastern Europe, USSR Zone 1
+
+
+ FWT
+ +2:00
+ French Winter Time
+
+
+ IST
+ +2:00
+ Israel Std Time
+
+
+ MEST
+ +2:00
+ Middle Europe Summer Time
+
+
+ METDST
+ +2:00
+ Middle Europe Daylight Time
+
+
+ SST
+ +2:00
+ Swedish Summer Time
+
+
+ BST
+ +1:00
+ British Summer Time
+
+
+ CET
+ +1:00
+ Central European Time
+
+
+ DNT
+ +1:00
+ Dansk Normal Tid
+
+
+ DST
+ +1:00
+ Dansk Standard Time (?)
+
+
+ FST
+ +1:00
+ French Summer Time
+
+
+ MET
+ +1:00
+ Middle Europe Time
+
+
+ MEWT
+ +1:00
+ Middle Europe Winter Time
+
+
+ MEZ
+ +1:00
+ Middle Europe Zone
+
+
+ NOR
+ +1:00
+ Norway Standard Time
+
+
+ SET
+ +1:00
+ Seychelles Time
+
+
+ SWT
+ +1:00
+ Swedish Winter Time
+
+
+ WETDST
+ +1:00
+ Western Europe Daylight Savings Time
+
+
+ GMT
+ 0:00
+ Greenwish Mean Time
+
+
+ WET
+ 0:00
+ Western Europe
+
+
+ WAT
+ -1:00
+ West Africa Time
+
+
+ NDT
+ -2:30
+ Newfoundland Daylight Time
+
+
+ ADT
+ -03:00
+ Atlantic Daylight Time
+
+
+ NFT
+ -3:30
+ Newfoundland Standard Time
+
+
+ NST
+ -3:30
+ Newfoundland Standard Time
+
+
+ AST
+ -4:00
+ Atlantic Std Time (Canada)
+
+
+ EDT
+ -4:00
+ Eastern Daylight Time
+
+
+ ZP4
+ -4:00
+ GMT +4 hours
+
+
+ CDT
+ -5:00
+ Central Daylight Time
+
+
+ EST
+ -5:00
+ Eastern Standard Time
+
+
+ ZP5
+ -5:00
+ GMT +5 hours
+
+
+ CST
+ -6:00
+ Central Std Time
+
+
+ MDT
+ -6:00
+ Mountain Daylight Time
+
+
+ ZP6
+ -6:00
+ GMT +6 hours
+
+
+ MST
+ -7:00
+ Mountain Standard Time
+
PDT
-7:00
@@ -1539,90 +1589,40 @@ the time zone becomes GMT (on most systems anyway).
-8:00
Pacific Std Time
-
- SADT
- +10:30
- South Australian Daylight Time
-
-
- SAT
- +9:30
- South Australian Std Time
-
-
- SET
- +1:00
- Seychelles Time
-
-
- SST
- +2:00
- Swedish Summer Time
-
-
- SWT
- +1:00
- Swedish Winter Time
-
-
- WADT
- +8:00
- West Australian Daylight Time
-
-
- WAST
- +7:00
- West Australian Std Time
-
-
- WAT
- -1:00
- West Africa Time
-
-
- WDT
- +9:00
- West Australian Daylight Time
-
-
- WET
- 0:00
- Western Europe
-
-
- WETDST
- +1:00
- Western Europe Daylight Savings Time
-
-
- WST
- +8:00
- West Australian Std Time
-
YDT
-8:00
Yukon Daylight Time
+
+ HDT
+ -9:00
+ Hawaii/Alaska Daylight Time
+
YST
-9:00
Yukon Standard Time
- ZP4
- -4:00
- GMT +4 hours
+ AHST
+ -10:00
+ Alaska-Hawaii Std Time
- ZP5
- -5:00
- GMT +5 hours
+ CAT
+ -10:00
+ Central Alaska Time
- ZP6
- -6:00
- GMT +6 hours
+ NT
+ -11:00
+ Nome Time
+
+
+ IDLW
+ -12:00
+ International Date Line, West
@@ -1633,17 +1633,21 @@ the time zone becomes GMT (on most systems anyway).
then EST refers to Australia Eastern Std Time,
which has an offset of +10:00 hours from UTC.
-
-
- It is interesting that Australian time zones and their naming variants
- account for fully one quarter of all time zones in the
- Postgres time zone lookup table.
-
+
+
+ Australian time zones and their naming variants
+ account for fully one quarter of all time zones in the
+ Postgres time zone lookup table.
Date/Time Input Interpretation
+
+
+ The date/time types are all decoded using a common set of routines.
+
+
Break the input string into tokens and categorize each token as
@@ -1717,48 +1721,89 @@ the time zone becomes GMT (on most systems anyway).
- The token is a number or number field. If there are more than 4 digits,
+ The token is a number or number field.
+ If there are more than 4 digits,
and if no other date fields have been previously read, then interpret
- as a "concatenated date".
+ as a "concatenated date" (e.g. 19990118).
- If there
+
+ If there are more than 4 digits,
+ and if no other date fields have been previously read, then interpret
+ as a "concatenated date" (e.g. 19990118).
+
+
+
+
+
+ If three digits and a year has already been decoded, then interpret as day of year.
+
+
+
+
+
+ If longer than two digits, then interpret as a year.
+
+
+
+
+
+ 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.
+
+
+
+
+
+ If in non-European (US) date mode, and if the month field has not yet been read,
+ and if the value is less than or equal to 12, then interpret as a month.
+
+
+
+
+
+ If the day field has not yet been read,
+ and if the value is less than or equal to 31, then interpret as a month.
+
+
+
+
+
+ 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.
+
+
+
+
+
+ Otherwise, interpret as a year.
+
+ If BC has been specified, negate the year and offset by one
+ (there is no year zero in the Gregorian calendar).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 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.
-
+
-
-datetime
+
+ datetime
General-use date and time is input using a wide range of
@@ -2377,7 +2422,7 @@ the bits part.