Format string for ISO-8601 date and time

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Format string for ISO-8601 date and time
Date: 2009-02-26 09:50:18
Message-ID: 4f4838cf-149d-44a5-bedd-f2b3ab18feac@mm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Is there a format string for to_char(timestamptz, text) that would
output a timestamp in full ISO-8601 format? That is, something like
1977-04-22T01:00:00-05:00

I can't find a way to extract the offset against GMT from the docs
here:
http://www.postgresql.org/docs/8.3/static/functions-formatting.html

If not, what would be the way to convert a timestamp to such a string
regardless of the session's datestyle settings?

Thanks,

--
Daniel

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2009-02-26 10:02:14 Re: funny view/temp table problem with query
Previous Message Alban Hertroys 2009-02-26 09:46:30 Re: funny view/temp table problem with query