在 Presto 中转换 unix 时间
Casting unix time to date in Presto
我有自纪元 (ms) 以来的时间戳,我想使用 'yyyy-mm-dd'.
格式的日期查询和显示结果
cast(from_unixtime(unixtime) as date)
有关更多日期时间函数,请参阅 https://prestodb.io/docs/current/functions/datetime.html。
如你所说epoc(ms)
除以 1000 会将其转换为秒。
日期(from_unixtime(min(ts)/1000))
这帮助我将纪元时间保存为 BigInt 并存储为精确到毫秒。
我有自纪元 (ms) 以来的时间戳,我想使用 'yyyy-mm-dd'.
格式的日期查询和显示结果cast(from_unixtime(unixtime) as date)
有关更多日期时间函数,请参阅 https://prestodb.io/docs/current/functions/datetime.html。
如你所说epoc(ms)
除以 1000 会将其转换为秒。
日期(from_unixtime(min(ts)/1000))
这帮助我将纪元时间保存为 BigInt 并存储为精确到毫秒。