Javascript Date get number of seconds since the Epoch
let seconds = Math.floor(Date.now() / 1000) console.log(seconds);
The code uses Math.floor() not Math.round() since it return the actual second passed.
floor()
round()