Re: Getting 2002-12-18T17:32:40-05:00 (ISO 8601) from to_date() - Mailing list pgsql-general

From Tom Lane
Subject Re: Getting 2002-12-18T17:32:40-05:00 (ISO 8601) from to_date()
Date
Msg-id 18619.1040312037@sss.pgh.pa.us
Whole thread Raw
In response to Getting 2002-12-18T17:32:40-05:00 (ISO 8601) from to_date()  (Karl DeBisschop <kdebisschop@alert.infoplease.com>)
List pgsql-general
Karl DeBisschop <kdebisschop@alert.infoplease.com> writes:
> Second is the 'T' after the date part (where you might otherwise have a
> space).

This seems to be a bug in the to_date parser:

regression=# select to_char(now(),'YYYY-MM-DDT HH24:MI:SS');
       to_char
----------------------
 2002-12-19T 10:32:05
(1 row)

regression=# select to_char(now(),'YYYY-MM-DD THH24:MI:SS');
       to_char
----------------------
 2002-12-19 T10:32:08
(1 row)

regression=# select to_char(now(),'YYYY-MM-DDTHH24:MI:SS');
        to_char
-----------------------
 2002-12-19THH24:32:10
(1 row)

If the first two both work, I don't see why the third case shouldn't ...

            regards, tom lane

pgsql-general by date:

Previous
From: "Peter Gibbs"
Date:
Subject: Re: Getting 2002-12-18T17:32:40-05:00 (ISO 8601) from to_date()
Next
From: "Peter Gibbs"
Date:
Subject: Re: Getting 2002-12-18T17:32:40-05:00 (ISO 8601) from to_date()