Copyright © tutorialspoint.com

Javascript Date - valueOf Method

previous next

Advertisements


Description:

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.

Syntax:

Date.valueOf()

Here is the detail of parameters:

Return Value:

Returns the primitive value of a Date object.

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>

This will produce following result on 29th Aug 2008 :

743850547000 

To understand it in better way you can Try it yourself.


previous next

Copyright © tutorialspoint.com