数码资讯
PostgreSQL字符日期和UNIX时间戳转换(postgresql将日期时区转换)
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
一、日期格式转换
1.字符日期格式转化为UNIX时间戳格式
字段endtime为内容为UNIX时间戳格式,例如1346650755
select * from test where endtime >= extract(epoch FROM date('2012-09-03 00:00:00'));
2.UNIX时间戳转化为字符日期格式
select * from test where date(to_timestamp(endtime))>='2012-09-02';
select uid,date(to_timestamp(insert_time)),count(*) from pubinfo where uid in (56,57,58,59,60) group by uid,date(to_timestamp(insert_time)) order by uid,date(to_timestamp(insert_time))
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。