真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

PostgreSQL時(shí)間與Unix時(shí)間戳

1.unix時(shí)間戳---》 時(shí)間

成都創(chuàng)新互聯(lián)公司網(wǎng)站建設(shè)服務(wù)商,為中小企業(yè)提供成都網(wǎng)站制作、成都做網(wǎng)站、外貿(mào)營(yíng)銷網(wǎng)站建設(shè)服務(wù),網(wǎng)站設(shè)計(jì),網(wǎng)站托管等一站式綜合服務(wù)型公司,專業(yè)打造企業(yè)形象網(wǎng)站,讓您在眾多競(jìng)爭(zhēng)對(duì)手中脫穎而出成都創(chuàng)新互聯(lián)公司

# SELECT TIMESTAMP WITH TIME ZONE 'epoch' + 1471313356 * INTERVAL '1 second';

        ?column?        

------------------------

 2016-08-16 10:09:16+08

(1 row)

# SELECT TIMESTAMP WITHOUT TIME ZONE 'epoch' + 1471313356 * INTERVAL '1 second';

      ?column?       

---------------------

 2016-08-16 02:09:16

(1 row)

# SELECT TIMESTAMP WITH TIME ZONE 'epoch' + 1461033436.269 * INTERVAL '1 second';

          ?column?          

----------------------------

 2016-04-19 10:37:16.269+08

(1 row)

毫秒

# SELECT TIMESTAMP WITH TIME ZONE 'epoch' + 1464186650352 * INTERVAL '1 milliseconds';

          ?column?          

----------------------------

 2016-05-25 22:30:50.352+08

(1 row)

# SELECT TIMESTAMP WITHOUT TIME ZONE 'epoch' + 1464186650352 * INTERVAL '1 milliseconds';

        ?column?         

-------------------------

 2016-05-25 14:30:50.352

(1 row)

2.時(shí)間----》 Unix時(shí)間戳

# SELECT EXTRACT(EPOCH FROM TIMESTAMP WITHOUT TIME ZONE '2016-05-25 14:30:50.352');

   date_part    

----------------

 1464186650.352

(1 row)

# SELECT EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE '2016-05-25 14:30:50.352');

   date_part    

----------------

 1464157850.352

(1 row)

毫秒

# SELECT EXTRACT(EPOCH FROM TIMESTAMP WITHOUT TIME ZONE '2016-05-25 14:30:50.352')*1000;

   ?column?    

---------------

 1464186650352

(1 row)

postgres=# SELECT extract(epoch FROM '2017-02-07 11:18:23.098+08'::timestamp with time zone);

   date_part    

----------------

 1486437503.098

(1 row)

postgres=# select to_timestamp(1486437503.098);

        to_timestamp        

----------------------------

 2017-02-07 11:18:23.098+08

(1 row)

postgres=# 


當(dāng)前題目:PostgreSQL時(shí)間與Unix時(shí)間戳
文章分享:http://weahome.cn/article/pspdjs.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部