This method returns the primitive value of a Date object as a number data type, the number of milliseconds since midnight 01 January, 1970 UTC.
Its syntax is as follows −
Date.valueOf ()
Returns the primitive value of a Date object.
Try the following example.
<html> <head> <title>JavaScript valueOf Method</title> </head> <body> <script type="text/javascript"> var dateobject = new Date(1993, 6, 28, 14, 39, 7); document.write( dateobject.valueOf() ); </script> </body> </html>
743850547000