将秒添加到时间戳
问题描述:
我想在给定的时间戳中添加秒。将秒添加到时间戳
例:
鉴于时间:
Declare
t1 timestamp = '1900-01-01 02:00:00';
现在我想一些20 seconds
加入到给定的时间。
在SQL Server中,我使用了DATEADD
。但是我搜索并了解到PostgreSQL没有提供这样的功能。
什么是解决方案?
我想在给定的时间戳中添加秒。将秒添加到时间戳
例:
鉴于时间:
Declare
t1 timestamp = '1900-01-01 02:00:00';
现在我想一些20 seconds
加入到给定的时间。
在SQL Server中,我使用了DATEADD
。但是我搜索并了解到PostgreSQL没有提供这样的功能。
什么是解决方案?
只需检查日期/时间运营商:http://www.postgresql.org/docs/current/interactive/functions-datetime.html – 2015-02-23 11:50:46
@FrankHeikens,是啊!得到它了。谢谢 – MAK 2015-02-23 11:55:04