Tag: dbeaver

Cassandra – 插入时使用错误的时区

这是我试图插入到我的数据库的date: '1970-01-18T00:00:00+00:00' 但是当我查看数据库中的条目时,它的背后是8个小时: 1970-01-17 16:00:00 我的Ubuntu系统上使用的时区是UTC。 我通过在terminalinputdate检查输出: Tue Oct 4 00:00:53 UTC 2016 我正在使用node.js,这实际上是用来插入的代码: const Cassandra = require( 'cassandra-driver' ); const Promise = require( 'bluebird' ); const db = Promise.promisifyAll( new Cassandra.Client({ contactPoints: ['127.0.0.1'], keyspace: 'project' }) ); let date_created = '1970-01-18T00:00:00+00:00'; db.executeAsync( "INSERT INTO posts (id, date_created) VALUES (?, ?);", [someID, date_created], {prepare: true} […]