Welcome 微信登录

首页 / 数据库 / MySQL / 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 数据库  http://www.linuxidc.com/Linux/2015-12/126175.htmCentOS 6.3环境下yum安装PostgreSQL 9.3 http://www.linuxidc.com/Linux/2014-05/101787.htmPostgreSQL缓存详述 http://www.linuxidc.com/Linux/2013-07/87778.htmWindows平台编译 PostgreSQL http://www.linuxidc.com/Linux/2013-05/85114.htmUbuntu下LAPP(Linux+Apache+PostgreSQL+PHP)环境的配置与安装 http://www.linuxidc.com/Linux/2013-04/83564.htmUbuntu上的phppgAdmin安装及配置 http://www.linuxidc.com/Linux/2011-08/40520.htmCentOS平台下安装PostgreSQL9.3 http://www.linuxidc.com/Linux/2014-05/101723.htmPostgreSQL配置Streaming Replication集群 http://www.linuxidc.com/Linux/2014-05/101724.htm如何在CentOS 7/6.5/6.4 下安装PostgreSQL 9.3 与 phpPgAdmin  http://www.linuxidc.com/Linux/2014-12/110108.htm------------------------------------华丽丽的分割线------------------------------------PostgreSQL 的详细介绍:请点这里
PostgreSQL 的下载地址:请点这里本文永久更新链接地址