The getTime()
method returns the number of milliseconds since January 1, 1970:
Example
const d = new Date();
document.getElementById("demo").innerHTML = d.getTime();
document.getElementById("demo").innerHTML = d.getTime();
Practice Excercise Practice now