Contents

toDate()

Converts the JavaScript value to a date object.

Declaration

func toDate() -> Date!

Return Value

The date representation of the value.

Discussion

If the value contains a JavaScript Date object, this method returns an equivalent NSDate representation. Otherwise, this method uses JavaScript type coercion to interpret the value as a number of seconds and creates an NSDate object with the dateWithTimeIntervalSince1970: method.

See Also

Reading and Converting JavaScript Values