Akrem
Akrem

Reputation: 363

Timestamp comparison in hive

I need to compare date with format yyyy-MM-ddTHH:mm:ss+00:00 and yyyy-MM-dd HH:mm:ss

I tried with.

start_date > date_format('2021-12-15 00:00:00');

I got the results however the query returns additional line.

Any suggestions please

Upvotes: 1

Views: 182

Answers (1)

leftjoin
leftjoin

Reputation: 38335

Convert date predicate to the same format, like this:

date_format('2021-12-15 00:00:00', "yyyy-MM-dd'T'HH:mm:ss+00:00")

And take care about correct format. mm - means minutes, MM-means month, hh - is a 12 - base hours, not 24. HH- means 24 base hours. hh without am/pm makes no sense. Double check format in your question, it has multiple issues.

Upvotes: 1

Related Questions