- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Hive: Convert int timestamp to date
- Labels:
-
Apache Hive
Created on ‎02-10-2017 04:51 PM - edited ‎09-16-2022 04:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Given a column of type bigint, with a mili-second precision timestamp, like this 1485172800000
How can I get hive to give me a date, like this: 1/23/2017
I've done it before and I don't believe a UDF is necessary, but I can't seem to get it to work for me today.
Thanks!
Created ‎02-10-2017 04:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Found it on another thread: https://community.hortonworks.com/questions/69533/convert-unix-timestamp-to-timestamp-format.html
select from_unixtime(cast(time/1000 as bigint)) from table_1;
Created ‎02-10-2017 04:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Found it on another thread: https://community.hortonworks.com/questions/69533/convert-unix-timestamp-to-timestamp-format.html
select from_unixtime(cast(time/1000 as bigint)) from table_1;
