In this article, we will see how to fetch current date or current date-time in lower and higher versions of Apache Hive.
The instructions above yield the current “date and time” in seconds. This implies that the result will be a big integer value representing the number of seconds between the Unix epoch and the current date and time (this means as of now).
The above command returns the total number of seconds between Unix epoch to current “date”.
The above command will help in fetching the current date (excluding the time stamp).
The above commands are helpful if you are using Hive older versions, however if you are using Hive 2.0 or later versions, you can simply use the below to fetch just date or date with timestamp:
Hope you find this article helpful.
Please subscribe for more interesting updates.