Postgresql 时间转换

上一篇 / 下一篇  2016-07-18 10:32:47 / 个人分类:postgre

 
获得当前时间(精确到秒:
current_timestamp(0))向后一个月的时间戳:
select extract(epoch from current_timestamp(0)+ interval '1 month');
 date_part 
------------
 1468809117

获得当前时间:
dtasdb=# select current_timestamp;
              now             
-------------------------------
 2016-07-18 02:34:01.797557+00

精确到秒:
dtasdb=# select current_timestamp(0);
      timestamptz      
------------------------
 2016-07-18 02:34:24+00


TAG:

 

评分:0

我来说两句

日历

« 2024-05-07  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 4956
  • 日志数: 6
  • 建立时间: 2016-07-15
  • 更新时间: 2017-06-13

RSS订阅

Open Toolbar