Date.valueOf()
Returns the primitive value of a Date object
The valueOf() method returns the primitive value of a Date object.
Syntax
Return value
The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date.
Description
The valueOf()
method returns the primitive value of a Date
object as a number data type, the number of milliseconds since midnight 01 January, 1970 UTC.
This method is functionally equivalent to the Date.prototype.getTime()
method.
This method is usually called internally by JavaScript and not explicitly in code.
Examples
Using valueOf()
valueOf()
References
Contributors to this page
Uros Durdevic
Last updated