Converting date into epoch

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.

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#DateFunctionsandProperties-getTime