转换时间戳给出未来的结果

Convert timestamp gives result in the future

我有这个时间戳“1500473911936”,我正在尝试

select DATE_TRUNC('second',to_timestamp(1500473911936))

它给出“49518-02-16 04:52:16+00”而不是“2017-07-19 14:24:00+01”,就像我对

所做的那样
select DATE_TRUNC('second',CURRENT_TIMESTAMP)

我该怎么做?

您的时间戳以毫秒为单位, 你期待秒

尝试除以 1000

您的时间戳是毫秒格式。你试过 'millisecond' 而不是 'second' 吗?

select DATE_TRUNC('millisecond',to_timestamp(1500473911936))