JavaScript valueOf () method
Examples
Returns the Date object's original value:
var d=new Date();
var n=d.valueOf();
var n=d.valueOf();
n output:
try it"
Definition and Usage
valueOf () method returns a Date object's original value.
Note: The original value Returns the number of milliseconds January 1, 1970 since midnight!
Browser Support
valueOf () All major browsers support valueOf () method
grammar
Date.valueOf()
Return Value
Type | 描述 |
---|---|
Number | date 的毫秒表示。返回值和方法 Date.getTime 返回的值相等,返回1970年1月1日午夜以来的毫秒数。/td> |
technical details
JavaScript version: | 1.1 |
---|