The valueOf() method returns the primitive value of a Date object.
The valueOf() method returns the primitive value of a Date object.
The primitive value is returned as the number of millisecond since midnight January 1, 1970 UTC.
Date.valueOf()
A Number, representing the number of milliseconds between the date object and midnight January 1, 1970 UTC
Return the primitive value of a Date object:
//display the primitive value of a date object. var d = new Date(); var n = d.valueOf(); console.log(n);//w w w. j a v a 2s . com