Description
The valueOf() method is used to return the primitive value of a Date object.
Note: The primitive value is returned as the number of millisecond since midnight January 1, 1970.
This method has the form:
Date.valueOf()
Note: This method is usually called automatically by JavaScript, and not explicitly in code.
Examples
The following example shows the basic use of this method.
<script>
var d = new Date();
document.write(d.valueOf());
</script>
This produces the following result:
Browser Support
Firefox | IE | Chrome | Opera | Safari |
---|---|---|---|---|