js get milliseconds since epoch of date object code example
Example 1: get epoch timestamp js
Math.floor(Date.now() / 1000)
Example 2: get milliseconds since epoch for 12am today javascript
var d = new Date();
d.setUTCHours(0,0,0,0);
console.log(+d);