From 8be950f5c0a2d8591cfc9955ad4ee4baf50d6131 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 21 May 2012 11:56:00 -0400 Subject: [PATCH] Document that we deviate from ISO 8601 by not using 'T' on output. 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. --- doc/src/sgml/datatype.sgml | 45 ++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 2ac6a81aa3..7e4107cce8 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -2206,37 +2206,46 @@ January 8 04:05:06 1999 PST - 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. @@ -2253,29 +2262,33 @@ January 8 04:05:06 1999 PST 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 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. -- 2.40.0