how to convert date to seconds in js code example Example: javascript timestamp in seconds const ts = () => Math.floor(new Date().getTime() / 1000);