How to convert timestamp (with dot between second and millisecond) to date(yyyyMMdd) in Hive?

∥☆過路亽.° 提交于 2019-12-10 13:38:46

问题


I want to convert timestamp, 1490198341.705 for example, to date 20170323 and to hour 11 (GMT+8:00). Are there any functions to solve this?


回答1:


Try this:

select date_format(from_utc_timestamp(1490198341.705,'GMT+8:00'),'yyyyMMdd HH:mm:ss');


来源:https://stackoverflow.com/questions/42975333/how-to-convert-timestamp-with-dot-between-second-and-millisecond-to-dateyyyym

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!