3
votes

to_date function takes this "1970-11-01 00:00:00" as an input and returns "1970-11-01".

But I have epoch time as an input. How do I convert it to standard date format?

There is a function to convert standard date to unix epoch time but not the other way.

Any help is appreciated.

Thanks priyank

2

2 Answers

0
votes

To add to the other answers, in case your epoch time value is a String column in your hive table

SELECT TO_DATE(FROM_UNIXTIME(CAST(epoch_string AS BIGINT))) FROM hive_table;