如何在 Presto 中将时间戳转换为日期? [英] How to convert timestamp to date in Presto?
本文介绍了如何在 Presto 中将时间戳转换为日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我喜欢将时间戳列转换为日期和时间格式.我应该如何从 presto 编写查询?我的时间戳是 UTC 时间.非常感谢
I like to convert my timestamp columns to date and time format. How should I write the query from presto? my timestamp is UTC time. Thank you very much
Timestamp format"1506929478589"
After query convert it looks like "2016-10-25 21:04:08.436"
推荐答案
您可以使用 cast(col as date)
timestamp 转换为 date
> 或 date(col)
.
You can convert timestamp
to date
with cast(col as date)
or date(col)
.
这篇关于如何在 Presto 中将时间戳转换为日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文