cancel
Showing results for 
Search instead for 
Did you mean: 

Converting date into epoch

Matt
New Contributor

Hello,

We are calling an API that uses epoch date parameters. Is there a way to convert/parse UTC timestamps to epoch? I want to set a parameter startDate = Date.now() and in the GET POST query parameter, I want to call the startDate but parse it into the epoch.

2 REPLIES 2

cjhoward18
Employee
Employee

Hi Matt,

I believe you are looking for getTime().

Date.now().getTime() will return epoch time.

https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439344/Date+Functions+and+Properties#Date...

aakumar
New Contributor III

Thank you