Supported Versions: Current (16) / 15 / 14 / 13 / 12
Development Versions: devel
Unsupported versions: 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 / 8.1 / 8.0 / 7.4 / 7.3 / 7.2 / 7.1
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead.

Appendix A. Date/Time Support

Table of Contents
A.1. Date/Time Keywords
A.2. Time Zones
A.3. History of Units

PostgreSQL uses an internal heuristic parser for all date/time support. Dates and times are input as strings, and are broken up into distinct fields with a preliminary determination of what kind of information may be in the field. Each field is interpreted and either assigned a numeric value, ignored, or rejected. The parser contains internal lookup tables for all textual fields, including months, days of the week, and time zones.

This appendix includes information on the content of these lookup tables and describes the steps used by the parser to decode dates and times.

A.1. Date/Time Keywords

Table A-1. Month Abbreviations

Month Abbreviations
April Apr
August Aug
December Dec
February Feb
January Jan
July Jul
June Jun
March Mar
November Nov
October Oct
September Sep, Sept

Note: The month May has no explicit abbreviation, for obvious reasons.

Table A-2. Day of the Week Abbreviations

Day Abbreviation
Sunday Sun
Monday Mon
Tuesday Tue, Tues
Wednesday Wed, Weds
Thursday Thu, Thur, Thurs
Friday Fri
Saturday Sat

Table A-3. PostgreSQL Field Modifiers

Identifier Description
ABSTIME Keyword ignored
AM Time is before 12:00
AT Keyword ignored
JULIAN, JD, J Next field is Julian Day
ON Keyword ignored
PM Time is on or after after 12:00
T Next field is time

The keyword ABSTIME is ignored for historical reasons; in very old releases of PostgreSQL invalid ABSTIME fields were emitted as "Invalid Abstime". This is no longer the case however and this keyword will likely be dropped in a future release.