Mukul Kumar
Mukul Kumar

Reputation: 724

how to convert date into unix time in snowflake

I have a date in YYYY-MM-DD format and want to convert this in UNIX time in snowflake.

Function does this is MySQL:

UNIX_TIMESTAMP('1999-01-22')

MySQL output 916988400

How can I achieve the same in snowflake?

Upvotes: 1

Views: 2434

Answers (1)

Greg Pavlik
Greg Pavlik

Reputation: 11046

You can use the date_part function with epoch_second for the part:

select date_part(epoch_second, '1999-01-22'::timestamp);

Upvotes: 3

Related Questions