Search code examples
sqlhiveunix-timestamp

How to display a timestamp in DD-MMM-YYYY HH:MM:SS in hive


My data column has "2022-04-09 11:30:00" and i need to display it as "09-Apr-2022 11:30:00"

i am not familiar with unix_timestamp


Solution

  • You can use date_format() with desired formatted data.

    SELECT date_format('2022-04-09 11:30:00', 'yyyy-MMM-dd hh:mm:ss')
    

    enter image description here