PostgreSQL查詢結果中去掉時區和精度

來源:互聯網
上載者:User

PostgreSQL查詢結果中去掉時區和精度

原來一直使用PostgreSQL的函數來拼湊,今天突然發現竟然可以這麼簡單,直接用timestamp(0)來解決就好了:

  1. ls=> select createtime::timestamp(0) without time zone from users;
  2.      createtime
  3. ---------------------
  4.  2015-10-03 01:32:03
  5.  2015-10-03 01:32:03
  6.  2015-10-03 01:32:03
  7. (3 行記錄)
  8. ls=> select createtime::timestamp without time zone from users;
  9.          createtime
  10. ----------------------------
  11.  2015-10-03 01:32:03.080415
  12.  2015-10-03 01:32:03.080415
  13.  2015-10-03 01:32:03.080415
  14. (3 行記錄)

------------------------------------華麗麗的分割線------------------------------------

Ubuntu Server 14.04 下安裝 PostgreSQL 9.3.5 資料庫 

CentOS 6.3環境下yum安裝PostgreSQL 9.3

PostgreSQL緩衝詳述

Windows平台編譯 PostgreSQL

Ubuntu下LAPP(Linux+Apache+PostgreSQL+PHP)環境的配置與安裝

Ubuntu上的phppgAdmin安裝及配置

CentOS平台下安裝PostgreSQL9.3

PostgreSQL配置Streaming Replication叢集

如何在CentOS 7/6.5/6.4 下安裝PostgreSQL 9.3 與 phpPgAdmin 

------------------------------------華麗麗的分割線------------------------------------

PostgreSQL 的詳細介紹:請點這裡
PostgreSQL 的:請點這裡

本文永久更新連結地址:

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.