Re: to_json(now()) result doesn't have 'T' separator - Mailing list pgsql-general

From Joe Van Dyk
Subject Re: to_json(now()) result doesn't have 'T' separator
Date
Msg-id CACfv+pK2veWXy+y=DC_nQDBtsb-ohVTns3YT28L+J+29VF9yLQ@mail.gmail.com
Whole thread Raw
In response to to_json(now()) result doesn't have 'T' separator  (Joe Van Dyk <joe@tanga.com>)
Responses Re: to_json(now()) result doesn't have 'T' separator  (Joe Van Dyk <joe@tanga.com>)
List pgsql-general


On Fri, Dec 20, 2013 at 4:18 PM, Joe Van Dyk <joe@tanga.com> wrote:
# select to_json(now());
             to_json
---------------------------------
 "2013-12-20 15:53:39.098204-08"
(1 row)

I'd like to see it output "2013-12-20T15:53:39.098204-08" so it's interchangeable with more systems.

Actually, "2013-12-20T15:53:39.44553-08:00" would be ideal.

 


I'm working with javascript/json systems that expect the 'T' to be there however, so there's no mutual agreement happening.

Thoughts? I know I can hack around it by specifying my own date format, but I'd really like to be able to use row_to_json and other functions without specifying custom date formats everywhere.

Joe

pgsql-general by date:

Previous
From: David Johnston
Date:
Subject: Re: Seems like bug in 9.1.3, need to confirm.
Next
From: Adrian Klaver
Date:
Subject: Re: pg_upgrade & tablespaces