原来一直使用postgresql的函数来拼凑,今天突然发现竟然可以这么简单,直接用timestamp(0)来解决就好了:
-
ls=> select createtime::timestamp(0) without time zone from users;
-
createtime
-
---------------------
-
2015-10-03 01:32:03
-
2015-10-03 01:32:03
-
2015-10-03 01:32:03
-
(3 行记录)
-
-
ls=> select createtime::timestamp without time zone from users;
-
createtime
-
----------------------------
-
2015-10-03 01:32:03.080415
-
2015-10-03 01:32:03.080415
-
2015-10-03 01:32:03.080415
-
(3 行记录)
阅读(5339) | 评论(0) | 转发(0) |