Returns the numeric value of the date as milliseconds since the epoch.
Syntax
date.getTime()Example
Enter values below to update the example in real time.
const→new→console→getTime→const date = new Date(2024, 0, 1);
console.log(date.getTime()); // 1704067200000