Query with time zone offset but without seconds

From: Marco <netuse(at)lavabit(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Query with time zone offset but without seconds
Date: 2011-03-25 17:05:59
Message-ID: 4d8ccb78$0$7652$9b4e6d93@newsspool1.arcor-online.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message salah jubeh 2011-03-25 17:13:57 Re: which view is used another views
Previous Message Rob Sargent 2011-03-25 17:05:53 Re: psql can't subtract