1

这个问题是不言自明的。我正在寻找与SQLite datetime function等效的 PostgreSQL 。

4

3 回答 3

6
postgres=# select to_char(now(),'YYYY-mm-dd HH:MM:ss');
       to_char
---------------------
 2008-09-24 02:09:20
(1 row)

postgres=# select to_char(now(),'YYYY-mm-dd HH24:MM:ss');
       to_char
---------------------
 2008-09-24 14:09:20
(1 row)
于 2008-09-24T12:49:10.190 回答
4

我认为这就是您正在寻找的内容:

时间戳 [ (p) ] [ 不带时区 ] 或时间戳 [ (p) ] 带时区

否则看看@ http://www.postgresql.org/docs/8.1/interactive/datatype-datetime.html

于 2008-09-24T12:53:32.410 回答
2

好的,感谢您的回答,他们帮助我指出了正确的方向。我实际上正在寻找的是to_timestamp

于 2008-09-24T13:15:41.420 回答