Expand Minimize
1 out of 1 rated this helpful - Rate this topic

valueOf Method (Date)

JavaScript - Internet Explorer 10

Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC.

date.valueOf()

The date object is any instance of a Date.

The stored time value in milliseconds since midnight, January 1, 1970 UTC. This is the same value as getTime.

The following example illustrates the use of the valueOf method with a date.

var myDate = new Date();
myDate.setFullYear(2100, 5, 5);
if (myDate.getTime() == myDate.valueOf())
    document.write("values are the same");
else
    document.write("values are different");

// Output: values are the same 

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards. Also supported in Windows Store apps. See Version Information.

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.