Skip site navigation (1) Skip section navigation (2)

ISO8601 nitpicking

From: Daniel Farina <daniel(at)heroku(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: ISO8601 nitpicking
Date: 2012-02-24 07:41:09
Message-ID: CAAZKuFZF5=raA=RLncqEg_8GsJ9vi4_E-fi1aOmK4zP+dxcx4g@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
As it turns out, evidence would suggests that the "ISO" output in
Postgres isn't, unless there's an ISO standard for date and time that
is referring to other than 8601.  It does not permit use of a space
between the date and the time, as seen in:

SELECT now();
              now
-------------------------------
 2012-02-23 23:31:59.580915-08
(1 row)

Thanks to Vasily Chekalkin for digging that up.  He was annoyed at the
time, so someone actually cares now and again, sample size one.

It is true that many common adaptations of ISO8601 do allow the space,
and many pages on the web that abstract the standard include that
variant, but it is not the letter of the standard, as far as I can
tell. It is an acceptable letter of the standard in RFC3339.  Unless
one actually digs down in the ISO document -- this is the third
edition(!) -- one may be misinformed.  Or perhaps it's buried in the
standard's PDF.

Here's a link to the standard:

http://dotat.at/tmp/ISO_8601-2004_E.pdf

I'm not sure if there's anything to be done here other than a mention
of errata in the manual.  Alternatively, datestyle = 'sql' and
datestyle = 'iso' may be reasonably different, after all.

-- 
fdr

Responses

pgsql-hackers by date

Next:From: Christoph BergDate: 2012-02-24 08:59:12
Subject: Re: Runtime SHAREDIR for testing CREATE EXTENSION
Previous:From: David E. WheelerDate: 2012-02-24 04:54:49
Subject: Re: row_to_json() Bug

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group