Tutorials Point


  JavaScript Basics
  JavaScript Objects
  JavaScript Advanced
  JS Useful References
  JS Useful Resources
  Selected Reading

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

Javascript Date - valueOf Method


previous next AddThis Social Bookmark Button


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:

  • NA

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 Printer Friendly

Advertisements


  

Advertisements