I am facing one issue in converting the date in hive. I need to convert 2017-sep-12 To 2017-09-12 . How can i achieve this in HIVE
Use unix_timestamp(string date, string pattern)
to convert given date format to seconds passed from 1970-01-01. Then use from_unixtime()
to convert to given format:
hive> select from_unixtime(unix_timestamp('2017-sep-12' ,'yyyy-MMM-dd'), 'dd-MM-yyyy');
OK
12-09-2017