Per discussion, we should explain that we follow RFC 3339 and not really
the letter of the ISO 8601 spec for timestamp output format. Mostly
Brendan Jurd's wording, though I tweaked it to clarify that we do take 'T'
on input. Minor additional copy-editing and markup-tweaking, too.
|
- ISO
- ISO 8601/SQL standard
- 1997-12-17 07:37:16-08
+ ISO
+ ISO 8601, SQL standard
+ 1997-12-17 07:37:16-08
|
- SQL
+ SQL
traditional style
- 12/17/1997 07:37:16.00 PST
+ 12/17/1997 07:37:16.00 PST
|
- POSTGRES
+ Postgres
original style
- Wed Dec 17 07:37:16 1997 PST
+ Wed Dec 17 07:37:16 1997 PST
|
- German
+ German
regional style
- 17.12.1997 07:37:16.00 PST
+ 17.12.1997 07:37:16.00 PST
+
+ ISO 8601 specifies the use of uppercase letter T> to separate
+ the date and time.
PostgreSQL> accepts that format on
+ input, but on output it uses a space rather than T>, as shown
+ above. This is for readability and for consistency with RFC 3339 as
+ well as some other database systems.
+
+
+
In the
SQL and POSTGRES styles, day appears before
month if DMY field ordering has been specified, otherwise month appears
before day.
(See
for how this setting also affects interpretation of input values.)
- shows an
- example.
+ shows examples.
|
SQL, DMY>
day/month/year
- 17/12/1997 15:37:16.00 CET
+ 17/12/1997 15:37:16.00 CET
|
SQL, MDY>
month/day/year
- 12/17/1997 07:37:16.00 PST
+ 12/17/1997 07:37:16.00 PST
|
Postgres, DMY>
day/month/year
- Wed 17 Dec 07:37:16 1997 PST
+ Wed 17 Dec 07:37:16 1997 PST
- The date/time styles can be selected by the user using the
+ The date/time style can be selected by the user using the
SET datestyle command, the
linkend="guc-datestyle"> parameter in the
postgresql.conf configuration file, or the
PGDATESTYLE environment variable on the server or
- client. The formatting function to_char
+ client.
+
+
+ The formatting function to_char
(see ) is also available as
a more flexible way to format date/time output.