Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql-如何将一个时间戳转换为另一个时间戳,并使其更接近一小时?_Postgresql_Timestamp_Postgresql 9.2 - Fatal编程技术网

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

我想你想要这个功能。

谢谢你完整的回答!