getTime()

ES1+

Returns the number of milliseconds since January 1, 1970 00:00:00 UTC.

Syntax

date.getTime()

Return Value

number

A number representing the milliseconds since UNIX epoch

Examples

JavaScript
const date = new Date('2024-01-15');
console.log(date.getTime());
Output:
// 1705276800000

Related Methods