smisra3
smisra3

Reputation: 107

Issue with unix_timestamp

I have to populate a field as 9999-12-31 for that I am using the below statement. But when I check in for result it's giving 9998-12-27 00:00:00

Select from_unixtime(unix_timestamp('9999-12-31','YYYY-MM-DD'))

Result: 9998-12-27 00:00:00

Upvotes: 0

Views: 341

Answers (1)

aaronshan
aaronshan

Reputation: 392

You should use it like this:

Select from_unixtime(unix_timestamp('9999-12-31','yyyy-MM-dd'));

Upvotes: 1

Related Questions