Date.valueOf

valueOf – Returns the primitive value of a Date object.

Description

Date.valueOf()

Since valueOf sometimes is used to implement other return values, it is recomended to use the getTime() method instead.

Return values

Integer

Examples

Example #1 – valueOf example
var date = new Date(); console.log(date.valueOf()); // Returns the timestamp of the given time.

See also

External references