DroidScript

JavaScript Reference

dateObj.valueOf()

The valueOf() method returns the primitive value of a Date object.

Syntax

dateObj.valueOf()

Parameters

None.

Description

The valueOf() method returns the primitive value of a Date object as a number data type, the number of milliseconds since midnight 01 January, 1970 UTC.

This method is functionally equivalent to the dateObj.getTime() method.

This method is usually called internally by JavaScript and not explicitly in code.

Examples

Using valueOf()

var x = new Date(56, 6, 17);
var myVar = x.valueOf();      // assigns -424713600000 to myVar

 Created by Mozilla Contributors and licensed under CC-BY-SA 2.5