Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const now = new Date();
- const start = moment(now) // get current datetime
- .utcOffset(0) // convert to UTC
- .subtract(24, "hours") // go 24 hours into the past
- .startOf("day") // get the start of the date we landed on
- .unix(); // get unix timestamp
- console.log(now);
- console.log(start);
- Sat Apr 20 2019 15:11:23 GMT-0400 (EDT) {}
- 1555650000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement