我收到错误{ [error: date/time field value out of range: "1439728672"] ..
我使用没有时区的时间戳作为列并执行如下所示的查询使用CURRENT_TIMESTAMP
我在另一个数据库/表中成功地做了我不知道为什么?
柱
"CreateDate" timestamp without time zone,
...
nodejs postgres
var query = 'INSERT INTO "Article" ("Content","CreateDate") VALUES ($1,CURRENT_TIMESTAMP) RETURNING "ArticleId"';
dbClient.query(query,[content], function(error, result) {
});
答案 0 :(得分:3)
CURRENT_TIMESTAMP
返回带时区的时间戳。您将CreateDate
定义为没有时区的时间戳。
来自manual:
CURRENT_TIME和CURRENT_TIMESTAMP提供带时区的值; LOCALTIME和LOCALTIMESTAMP提供没有时区的值。