Reputation: 47
I want to truncate a specific date to midnight time in hive. I have tried the following below, but it puts 12 hour time instead of 00.
date_format(MIN(date_and_time), 'yyyy-MM-dd hh:00:00.000')
Result obtained
2021-11-03 12:00:00.000
Any suggestions on that?
Thank you
Upvotes: 1
Views: 178
Reputation: 1269773
Use HH
for a 24-hour clock:
date_format(MIN(date_and_time), 'yyyy-MM-dd HH:00:00.000')
Upvotes: 3