Skip to main content
asish
Gold ⭐️⭐️⭐️
Gold ⭐️⭐️⭐️
Jun 27, 2021 2:10 PM UTC

How to display timestamps other than UTC in Hive

  • Oct 5, 2026 8:51 AM UTC
  • 0 replies
  • 2920 views
  • Translate All

As per HIVE-12192, by default, Hive displays timestamp in UTC. This article lists the Hive query commands that can be used to change the timestamp.

To display the current timestamp in Asia/Kolkata:

 

SELECT from_utc_timestamp(cast(from_unixtime(cast(current_timestamp() AS bigint)) as TIMESTAMP),"Asia/Kolkata")

 

To display a UNIX epoch number in Asia/Kolkata: 

 

 SELECT from_utc_timestamp(cast(from_unixtime(cast(1623943533 AS bigint)) as TIMESTAMP),"Asia/Kolkata") ;