代码之家  ›  专栏  ›  技术社区  ›  navigator

这是什么时间戳?

  •  0
  • navigator  · 技术社区  · 4 年前

    我们正在从第三方数据库中提取数据以供导出。其中两列是时间戳列,下面显示了一些值。时间戳应该表示来自GPS设备的UTC时间戳。它们存储为 int SQL Server数据库中的数据类型。

    enter image description here

    知道如何将此时间戳(例如368815303)转换为常规日期/时间吗?所看到的数字应该是最近的,即2020年9月内,并且应该代表最接近秒的时间。

    0 回复  |  直到 4 年前
        1
  •  1
  •   Gordon Linoff    4 年前

    根据评论,您将使用:

    select dateadd(second, 368815303, '1980-01-06')
    

    根据您的预期,基准时间约为2009年1月1日,这表明:

    select dateadd(second, 368815303, '2009-01-01')
    

    我不熟悉任何使用该时间作为基准时间的日期/时间纪元。这可能是某种定制的系统。

        2
  •  0
  •   Daxesh Radadiya    4 年前

    它看起来像某种纪元Unix时间戳。

    试试这个 Epoch Converter which converts timestamp to human date