Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. const now = new Date();
  2. const start = moment(now) // get current datetime
  3. .utcOffset(0) // convert to UTC
  4. .subtract(24, "hours") // go 24 hours into the past
  5. .startOf("day") // get the start of the date we landed on
  6. .unix(); // get unix timestamp
  7. console.log(now);
  8. console.log(start);
  9.  
  10. Sat Apr 20 2019 15:11:23 GMT-0400 (EDT) {}
  11. 1555650000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement