Converting date into epoch
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2020 08:33 AM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2020 09:48 AM
Hi Matt,
I believe you are looking for getTime().
Date.now().getTime() will return epoch time.
Reply
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 09:49 AM
Thank you
