Reputation: 1023
I want month name instead of month number from a Date passed in HIVE
I am doing
select Month(date_field) from <tablename>;
this gives me a month number. How to get month names ??
Upvotes: 4
Views: 22079
Reputation: 403
Use the below builtin function to get the month in short form. select from_unixtime(to_unix_timestamp ("28/01/2017 00:00:00",'dd/MM/yyyy HH:mm:ss'),'MMM')
Upvotes: 0
Reputation: 49260
Use MMM
with date_format
function.
date_format(date_field,'MMM')
To get the full month name, use
date_format(date_field,'MMMMM')
Upvotes: 12