postgresql获取Unix时间戳
-- timestamp to unix timestamp
渑池网站建设公司成都创新互联公司,渑池网站设计制作,有大型网站制作公司丰富经验。已为渑池上千余家提供企业网站建设服务。企业网站搭建\外贸网站制作要多少钱,请找那个售后服务好的渑池做网站的公司定做!
select now(), EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE 'now()')::int as ext, extract(epoch FROM now())::int, CURRENT_TIMESTAMP,date_part('epoch',CURRENT_TIMESTAMP)::int
-- unix timestamp to timestamp
SELECT TIMESTAMP WITH TIME ZONE 'epoch' + 982384720.12 * INTERVAL '1 second';
--SELECT TIMESTAMP WITH TIME ZONE 'epoch' + extract(epoch FROM now())* INTERVAL '1 second';
本文名称:postgresql获取Unix时间戳
文章来源:http://pwwzsj.com/article/jghhji.html