Date – getTime()
date.getTime()
getTime()
returns the number of milliseconds elapsed since January 1, 1970, UTC, up until this date
object
Examples
1. get the number of milliseconds elapsed since January 1, 1970, UTC up until current date
let date = new Date();
console.log(date);
console.log(date.getTime());