Postgresql-如何将一个时间戳转换为另一个时间戳,并使其更接近一小时?
我有以下时间戳值:Postgresql-如何将一个时间戳转换为另一个时间戳,并使其更接近一小时?,postgresql,timestamp,postgresql-9.2,Postgresql,Timestamp,Postgresql 9.2,我有以下时间戳值:2013-10-09 12:15:55.724+02 我想改为:2013-10-09 12:00:00.000+02 我尝试了以下方法: to_char(creation, 'yyyy-mm-dd HH:00:00.000') 如何设置时区格式TZ或TZ不好,因为它们分别返回CEST和CEST select date_trunc('hour', '2013-10-09 12:15:55.724+02'::timestamptz); 我想你想要这个功能。谢谢你完整的回答!
2013-10-09 12:15:55.724+02
我想改为:2013-10-09 12:00:00.000+02
我尝试了以下方法:
to_char(creation, 'yyyy-mm-dd HH:00:00.000')
如何设置时区格式TZ
或TZ
不好,因为它们分别返回CEST
和CEST
select date_trunc('hour', '2013-10-09 12:15:55.724+02'::timestamptz);
我想你想要这个功能。谢谢你完整的回答!