简体   繁体   中英

Converting timestamp to epoch in snowflake

I have timestamp in following format: "2022-03-08 17:11:59.901" , I want to convert them to UNIX/Epoch format up to milliseconds, somehow it only delivers till seconds part. Is there anyway to do it?

If you have a string timestamp and you want to convert to EPOCH:

SELECT to_timestamp('2022-03-08 17:11:59.901') as ts,
       date_part(EPOCH_MICROSECOND ,ts)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM