【发布时间】:2020-12-13 02:38:45
【问题描述】:
我最近开始使用 Grafana 来显示我的 PostgreSQL 数据库中的数据。 现在我已经达到了一个点选择数据并使用某个时间戳字段作为Grafana中的“时间”字段,所示的数据是日期+时区差异。
例如: 我的数据的时间戳为“2020-08-24 12:05:30”,我的时区为 UTC+3,但 Grafana 显示为“2020-08-24 15:05:30”。
有没有什么方法可以简单地显示我的数据库中存在的数据而不添加时区差异?
【问题讨论】:
-
保存数据的字段是
timestamp还是timestamp with time zone数据类型?该字段的数据来自哪里? -
我在没有时区的情况下尝试了dateTime和timestamp,没有尝试过timestamp。
-
Postgres 中没有 dateTime 类型。
timestamp是timestamp without time zone。在任何情况下你都不想使用它,你想要timestamp with time zone。我会花一些时间在这里PG Time and dates。
标签: postgresql datetime timezone grafana