javascript save date timestamp code example
Example 1: javascript timestamp in seconds
const ts = () => Math.floor(new Date().getTime() / 1000);
Example 2: how to get the timestamp in javascript
const currentTimeInMilliseconds=Date.now(); // unix timestamp in milliseconds
Example 3: convert datetime to timestamp javascript
function toTimestamp(strDate){ var datum = Date.parse(strDate); return datum/1000;}