Search Postgresql Archives

Re: How to get the time zone offset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, December 30, 2011 6:18:05 am Cezariusz Marek wrote:
> I need to convert timestamp to a format with a time zone offset, like this:
> 
> select clock_timestamp()::text;
> 
> and it returns the following value:
> 
> "2011-12-30 11:59:06.538+01"
> 
> What is the default format for timestamp::text conversion? I've tried this:
> 
> select to_char(clock_timestamp(), 'YYYY-MM-DD HH24:MI:SSTZ');
> 
> But it gives me "CET" instead of "+01":
> 
> "2011-12-30 11:59:06CET"

Maybe I am not understanding what you want, but why not:

select clock_timestamp()::text;

It gives you the format you want.

-- 
Adrian Klaver
adrian.klaver@xxxxxxxxx

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux