【问题标题】:Timestamps in QuestDB Python time.time() Not workingQuestDB Python time.time() 中的时间戳不起作用
【发布时间】:2022-07-06 19:34:33
【问题描述】:

我正在 QuestDB 中构建一个数据库。

我建了一张表,一列是时间戳。

关于表格的文档 = https://questdb.io/docs/guides/working-with-timestamps-timezones/

时间戳列正在自动将 1623167145123456 转换为“2021-06-08T16:45:45.123456Z”。

医生说: QuestDB 使用的原生时间戳格式是微秒分辨率的 Unix 时间戳。 QuestDB 不会将时区信息与时间戳值一起存储,因此应该假设所有时间戳都采用 UTC。以下示例显示了如何将 Unix 时间戳(以微秒为单位)直接传递到时间戳列中

当我尝试发送此栏时

time.time()

它不工作。

Python time.time() = 1657105707.8171313 文档输入 = 1623167145123456

当我在 python time.time() 中删除此空白并将其发送到时间戳列 输出是:

2495-02-11T11:02:24.069445Z

我该怎么办?

【问题讨论】:

    标签: python timestamp questdb


    【解决方案1】:

    试试这个int(time.time() * 1000000000)

    this example 中的我可以将开放数据从 TFL 发送到 QuestDB

    【讨论】:

      猜你喜欢
      • 2015-08-12
      • 2013-05-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多