Cassandra - 更新时间戳列无法正常工作

Cassandra - Update Timestamp column not working properly

正在尝试更新 Cassandra 数据库中的 Timestamp 列。

update sample set date='2016-10-21 19:15:10.000' where rowkey=1;

当我检查结果时,它小于 5:30 hours

输出:

2016-10-21 13:45:10.000000+0000

这与 Locale 有关吗?我尝试以编程方式更新相同的输出,相同的输出。

这是因为根据 CASSANDRA-10000 in versions 2.1.9, 2.2.1, and 3.0 (beta). It was fixed to show timestamps while applying the local timezone offset in CASSANDRA-10397 版本 2.2.6、3.0.4、3.4,cqlsh 仅 显示 UTC 时间戳。

如果这对您来说是个问题,升级到最新版本的 Cassandra 应该可以纠正这个问题。