From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
---|---|
To: | "Cezariusz Marek" <cezariusz(dot)marek(at)comarch(dot)pl> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: How to get the time zone offset |
Date: | 2011-12-30 16:36:56 |
Message-ID: | 201112300836.57138.adrian.klaver@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Friday, December 30, 2011 8:19:51 am Cezariusz Marek wrote:
>
> Because I need more control. In this case I need the date in XML format, so
> it will be something like this:
>
> select to_char(clock_timestamp(), 'YYYY-MM-DD"T"HH24:MI:SSTZ');
So something like this:
test(5432)postgres=#select to_char(clock_timestamp(), 'YYYY-MM-DD"T"HH24:MI:SS') || extract(timezone_hour from clock_timestamp());
?column?
-----------------------
2011-12-30T08:34:22-8
>
> Is the timestamp::text format always the same, regardless of the current
> locale and language settings?
I don't know.
--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Carlos Mennens | 2011-12-30 16:50:57 | Dated Version of PostgreSQL |
Previous Message | Bèrto ëd Sèra | 2011-12-30 16:20:58 | Re: duplicate key errors when restoring 8.4.0 database dump into 9.1.2 |