js milisseconds since epoch 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);
Math.floor(Date.now() / 1000)
var d = new Date();
d.setUTCHours(0,0,0,0);
console.log(+d);