JavaScript Date valueOf() Method
Clash Royale CLAN TAG#URR8PPP
<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]-->
JavaScript Date valueOf() Method
❮ JavaScript Date Object
Example
Return the primitive value of a Date object:
var d = new Date();
var n = d.valueOf();
<!--
The result of n will be:
var d=new Date();
document.write(d.valueOf());
-->Try it Yourself »
Definition and Usage
The valueOf() method returns the primitive value of a Date object.
Note: The primitive value is returned as the number of millisecond since midnight January 1, 1970 UTC.
Browser Support
Method | |||||
---|---|---|---|---|---|
valueOf() | Yes | Yes | Yes | Yes | Yes |
Syntax
Date.valueOf()
Parameters
None |
Technical Details
Return Value: | A Number, representing the number of milliseconds between the date object and midnight January 1, 1970 UTC |
---|---|
JavaScript Version: | ECMAScript 1 |
❮ JavaScript Date Object