How to get current timestamp in seconds in JavaScript

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

console.log(timestamp); //in seconds
1514300500
Date.now on MDN