用到presto两个函数

1. from_unixtime

2.format_datetime

select
'1566748800000',
substr('1566748800000',1,10) as a,
from_unixtime(cast(substr('1566748800000',1,10) as int)) as b, -- 将13位毫秒级的unix timestamp截取到秒级别
format_datetime(from_unixtime(cast(substr('1566748800000',1,10) as int)),'yyyy-MM-dd')

 

转换结果

presto unixtimestamp转标准日期

参考资料 https://prestodb.github.io/docs/current/functions/datetime.html

 

相关文章:

  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2021-06-10
  • 2022-12-23
猜你喜欢
  • 2021-08-22
  • 2022-02-20
  • 2021-08-29
  • 2021-11-02
  • 2021-11-30
  • 2021-12-27
相关资源
相似解决方案