How to get current timestamp in seconds in JavaScript

Datetime
Last updated Dec 26, 2017
const timestamp = Math.floor(Date.now() / 1000);

console.log(timestamp); //in seconds
1514300500