Number (function)

Converts the specified object to a number.

Core function

Syntax

Number( obj )

Parameter

obj An object

Description

Number is a top-level function and is not associated with any object.

When the object is a Date object, Number returns a value in milliseconds measured from 01 January, 1970 UTC (GMT), positive after this date, negative before.

If obj is a string that does not contain a well-formed numeric literal, Number returns NaN.

Example

The following example converts the Date object to a numerical value:

This produces the result "819199440000."

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.