now timestamp js code example
Example 1: js timestamp
var timestamp = new Date().getTime();
Example 2: time stamp to date js
let date1 = "15/03/2020";
let date2 = "15:03"
var date = date1.split("/")
date= date[2] + "-" + date[1] + "-" + date[0]
date = new Date(date + "T" + date2 + ":00")
console.log(date.getTime())
date = date.toLocaleString()
console.log(date)
Example 3: get epoch timestamp js
Math.floor(Date.now() / 1000)
Example 4: how to get the timestamp in javascript
const currentTimeInSeconds=Math.floor(Date.now()/1000);