Describe the date/time parsing rules.
authorThomas G. Lockhart
Sat, 13 Feb 1999 03:42:10 +0000 (03:42 +0000)
committerThomas G. Lockhart
Sat, 13 Feb 1999 03:42:10 +0000 (03:42 +0000)
Include specific information on the supported time zones.
 It's a really big table, so maybe it should go into an appendix instead.

doc/src/sgml/datatype.sgml

index 1a8dcadda48dcbca632f07511d4dfbce385eac71..e6ff993b104990647842b7afbe1bcb9c530c7407 100644 (file)
@@ -1255,19 +1255,24 @@ the time zone becomes GMT (on most systems anyway).
        
        
    
-    ACSST
-    +10:30 
-    Central Australia Summer Std Time
+    NZDT
+    +13:00
+    New Zealand Daylight Time
    
    
-    ACST
-    +09:30 
-    Central Australia Std Time
+    IDLE
+    +12:00
+    International Date Line, East
    
    
-    ADT
-    -02:00 
-    Atlantic Daylight Time
+    NZST
+    +12:00
+    New Zealand Std Time
+   
+   
+    NZT
+    +12:00
+    New Zealand Time
    
    
     AESST
@@ -1275,44 +1280,44 @@ the time zone becomes GMT (on most systems anyway).
     Australia Eastern Summer Std Time
    
    
-    AEST
-    +10:0
-    Australia Eastern Std Time
+    ACSST
+    +10:3
+    Central Australia Summer Std Time
    
    
-    AHST
-    -10:0
-    Alaska-Hawaii Std Time
+    CADT
+    +10:3
+    Central Australia Daylight Savings Time
    
    
-    AST
-    -4:00 
-    Atlantic Std Time (Canada)
+    SADT
+    +10:30
+    South Australian Daylight Time
    
    
-    AWSST
-    +9:00 
-    Australia Western Summer Std Time
+    AEST
+    +10:00 
+    Australia Eastern Std Time
    
    
-    AWST
-    +8:00 
-    Australia Western Std Time
+    EAST
+    +10:00 
+    East Australian Std Time
    
    
-    BST
-    +1:00 
-    British Summer Time
+    GST
+    +10:00
+    Guam Std Time, USSR Zone 9
    
    
-    BT
-    +3:00 
-    Baghdad Time
+    LIGT
+    +10:00
+    Melbourne, Australia
    
    
-    CADT
-    +10:30 
-    Central Australia Daylight Savings Time
+    ACST
+    +09:30 
+    Central Australia Std Time
    
    
     CAST
@@ -1320,155 +1325,145 @@ the time zone becomes GMT (on most systems anyway).
     Central Australia Std Time
    
    
-    CAT
-    -10:00 
-    Central Alaska Time
-   
-   
-    CCT
-    +8:00 
-    China Coastal Time
+    SAT
+    +9:30
+    South Australian Std Time
    
    
-    CDT
-    -5:00 
-    Central Daylight Time
+    AWSST
+    +9:00 
+    Australia Western Summer Std Time
    
    
-    CET
-    +1:00 
-    Central European Time
+    JST
+    +9:00
+    Japan Std Time,USSR Zone 8
    
    
-    CETDST
-    +2:00 
-    Central European Daylight Savings Time
+    KST
+    +9:00
+    Korea Standard Time
    
    
-    CST
-    +6:00 
-    Central Std Time
+    WDT
+    +9:00
+    West Australian Daylight Time
    
    
-    DNT
-    +1:00 
-    Dansk Normal Tid
+    MT
+    +8:30
+    Moluccas Time
    
    
-    DST
-    +1:00 
-    Dansk Standard Time (?)
+    AWST
+    +8:00 
+    Australia Western Std Time
    
    
-    EAST
-    +10:00 
-    East Australian Std Time
+    CCT
+    +8:00 
+    China Coastal Time
    
    
-    EDT
-    -4:00 
-    Eastern Daylight Time
+    WADT
+    +8:00
+    West Australian Daylight Time
    
    
-    EET
-    +2:00 
-    Eastern Europe, USSR Zone 1
+    WST
+    +8:00
+    West Australian Std Time
    
    
-    EETDST
-    +3:00 
-    Eastern Europe Daylight Savings Time
+    JT
+    +7:30
+    Java Time
    
    
-    EST
-    -5:00 
-    Eastern Standard Time
+    WAST
+    +7:00
+    West Australian Std Time
    
    
-    FST
-    +1:00 
-    French Summer Time
+    IT
+    +3:30
+    Iran Time
    
    
-    FWT
-    +2:00
-    French Winter Time
+    BT
+    +3:00 
+    Baghdad Time
    
    
-    GMT
-    0:00
-    Greenwish Mean Time
+    EETDST
+    +3:00 
+    Eastern Europe Daylight Savings Time
    
    
-    GST
-    +10:00
-    Guam Std Time, USSR Zone 9
+    CETDST
+    +2:00 
+    Central European Daylight Savings Time
    
    
-    HDT
-    -9:00
-    Hawaii/Alaska
+    EET
+    +2:00 
+    Eastern Europe, USSR Zone 1
    
    
-    IDLE
-    +12:00
-    International Date Line, East
+    FWT
+    +2:00
+    French Winter Time
    
    
-    IDLW
-    -12:00
-    International Date Line, West
+    IST
+    +2:00
+    Israel Std Time
    
    
-    IST
+    MEST
     +2:00
-    Israel
+    Middle Europe Summer Time
    
    
-    IT
-    +3:40
-    Iran Time
+    METDST
+    +2:00
+    Middle Europe Daylight Time
    
    
-    JST
-    +9:00
-    Japan Std Time,USSR Zone 8
+    SST
+    +2:00
+    Swedish Summer Time
    
    
-    JT
-    +7:30
-    Java Time
+    BST
+    +1:00 
+    British Summer Time
    
    
-    KST
-    +9:00
-    Korea Standard Time
+    CET
+    +1:00 
+    Central European Time
    
    
-    LIGT
-    +10:00
-    Melbourne, Australia
+    DNT
+    +1:00 
+    Dansk Normal Tid
    
    
-    MDT
-    -6:00
-    Mountain Daylight Time
+    DST
+    +1:00 
+    Dansk Standard Time (?)
    
    
-    MEST
-    +2:00
-    Middle Europe Summer Time
+    FST
+    +1:00 
+    French Summer Time
    
    
     MET
     +1:00
     Middle Europe Time
    
-   
-    METDST
-    +2:00
-    Middle Europe Daylight Time
-   
    
     MEWT
     +1:00
@@ -1480,149 +1475,154 @@ the time zone becomes GMT (on most systems anyway).
     Middle Europe Zone
    
    
-    MST
-    -7:00
-    Mountain Standard Time
-   
-   
-    MT
-    +8:30
-    Moluccas Time
+    NOR
+    +1:00
+    Norway Standard Time
    
    
-    NDT
-    -2:30
-    Newfoundland Daylight Time
+    SET
+    +1:00
+    Seychelles Time
    
    
-    NFT
-    -3:30
-    Newfoundland Standard Time
+    SWT
+    +1:00
+    Swedish Winter Time
    
    
-    NOR
+    WETDST
     +1:00
-    Norway Standard Time
+    Western Europe Daylight Savings Time
    
    
-    NST
-    -3:30
-    Newfoundland Standard Time
+    GMT
+    0:00
+    Greenwish Mean Time
    
    
-    NT
-    -11:00
-    Nome Time
+    WET
+    0:00
+    Western Europe
    
    
-    NZDT
-    +13:00
-    New Zealand Daylight Time
+    WAT
+    -1:00
+    West Africa Time
    
    
-    NZST
-    +12:00
-    New Zealand Std Time
+    NDT
+    -2:30
+    Newfoundland Daylight Time
    
    
-    NZT
-    +12:00
-    New Zealand Time
+    ADT
+    -03:00 
+    Atlantic Daylight Time
    
    
-    PDT
-    -7:00
-    Pacific Daylight Time
+    NFT
+    -3:30
+    Newfoundland Standard Time
    
    
-    PST
-    -8:00
-    Pacific Std Time
+    NST
+    -3:30
+    Newfoundland Standard Time
    
    
-    SADT
-    +10:30
-    South Australian Daylight Time
+    AST
+    -4:00 
+    Atlantic Std Time (Canada)
    
    
-    SAT
-    +9:30
-    South Australian Std Time
+    EDT
+    -4:00 
+    Eastern Daylight Time
    
    
-    SET
-    +1:00
-    Seychelles Time
+    ZP4
+    -4:00
+    GMT +4 hours
    
    
-    SST
-    +2:00
-    Swedish Summer Time
+    CDT
+    -5:00 
+    Central Daylight Time
    
    
-    SWT
-    +1:00
-    Swedish Winter Time
+    EST
+    -5:00 
+    Eastern Standard Time
    
    
-    WADT
-    +8:00
-    West Australian Daylight Time
+    ZP5
+    -5:00
+    GMT +5  hours
    
    
-    WAST
-    +7:00
-    West Australian Std Time
+    CST
+    -6:00 
+    Central Std Time
    
    
-    WAT
-    -1:00
-    West Africa Time
+    MDT
+    -6:00
+    Mountain Daylight Time
    
    
-    WDT
-    +9:00
-    West Australian Daylight Time
+    ZP6
+    -6:00
+    GMT +6  hours
    
    
-    WET
-    0:00
-    Western Europe
+    MST
+    -7:00
+    Mountain Standard Time
    
    
-    WETDST
-    +1:00
-    Western Europe Daylight Savings Time
+    PDT
+    -7:00
+    Pacific Daylight Time
    
    
-    WST
-    +8:00
-    West Australian Std Time
+    PST
+    -8:00
+    Pacific 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.