javascript timestamp in seconds
snippet in javascript

javascript timestamp in seconds

user3841

const ts = () => Math.floor(new Date().getTime() / 1000);

javascript get timestamp

user4877

var currentTimeInSeconds=Math.floor(Date.now()/1000); //unix timestamp in seconds
var currentTimeInMilliseconds=Date.now(); // unix timestamp in milliseconds

how to get timestamp in javascript of a date object

user7283

new Date().getTime()

new Date().valueOf()

node get unix timestamp

user6070

Math.floor(new Date() / 1000) // in seconds

how to get seconds in timstamps js

user3637

var seconds = new Date().getTime() / 1000;