我"2016-10-25T00:14:30.000"在PostgreSQL中有一个字符串。
"2016-10-25T00:14:30.000"
我想将时间戳转换为整数,例如:1477354441
我想向该值添加自定义分钟,例如 1477354441+544(minutes) = 1477387081
1477354441+544(minutes) = 1477387081
如何在PostgreSQL中实现呢?
SELECT EXTRACT(EPOCH FROM TIMESTAMP '2016-10-25T00:14:30.000'); SELECT EXTRACT(EPOCH FROM TIMESTAMP '2016-10-25T00:14:30.000' + INTERVAL '544 min');