How do you render a ledger's Unix seconds as a UTC date?

The unixepoch modifier interprets a number as elapsed seconds since the UTC epoch in 1970.

SQLite example and interpretation

86400 is midnight on the second day. Convert millisecond inputs first or the result can be far off or outside the supported range.

SELECT datetime(86400,'unixepoch');

Result [["1970-01-02 00:00:00"]]

中文

如何将链上 Unix 秒时间戳转成 UTC 日期?

datetime 的 unixepoch 修饰符将数值解释为自 1970 年 UTC 起点以来的秒数。

SQLite 示例与适用条件

86400 对应第二天零时。若上游字段以毫秒计,先换算单位,否则日期会严重偏移或超出范围。

SELECT datetime(86400,'unixepoch');

结果 [["1970-01-02 00:00:00"]]

References / 参考来源

Keep reading / 继续阅读