Reputation: 43053
I have the following timestamp value : 2013-10-09 12:15:55.724+02
I would like to have this instead : 2013-10-09 12:00:00.000+02
I have tried the following :
to_char(creation, 'yyyy-mm-dd HH:00:00.000')
How can I format the timezone ? TZ
or tz
are not good since they return CEST
and cest
respectively.
Upvotes: 1
Views: 85
Reputation: 125444
select date_trunc('hour', '2013-10-09 12:15:55.724+02'::timestamptz);
http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC
Upvotes: 2