Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 536
xunyulin Avatar asked Mar 23 '17 11:03

xunyulin


1 Answers

Try this:

select date_format(from_utc_timestamp(1490198341.705,'GMT+8:00'),'yyyyMMdd HH:mm:ss');
like image 63
leftjoin Avatar answered Oct 23 '22 03:10

leftjoin