【问题标题】:Grafana adds the timezone difference to datesGrafana 将时区差异添加到日期
【发布时间】: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 类型。 timestamptimestamp without time zone。在任何情况下你都不想使用它,你想要timestamp with time zone。我会花一些时间在这里PG Time and dates

标签: postgresql datetime timezone grafana


【解决方案1】:

转到仪表板设置并确保时区设置为 UTC 或数据使用的任何时区。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多