Search Postgresql Archives

Query with time zone offset but without seconds

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

 



I have a column Âtimestamp with time zoneÂ. I want to extract the date/time in
a different format including the time zone offset in a query but without
seconds. If I do

  select to_char(datetime, 'YYYY-MM-DD HH24:MI') from table;

then the time zone offset is missing in the output: 2011-03-25 18:01
If I do

  select date_trunc( 'minute', datetime) from table;

then the time zone offset is present, but the seconds are not removed:
2011-03-25 18:01:00+01

I want it to look like this: 2011-03-25 18:01+01

How to do that?


Marco


-- 
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