Date

JavaScript 1.0+, ECMAScript 1.0+, JScript 1.0+ Nav2+, NES2+, IE 3+, Opera3+ Syntax

var variable = new Date();
var variable = new Date(milliseconds1);
var variable = new Date(string)
var variable = new Date(year, month, day, hours, minutes, seconds,
							milliseconds2)

Description

The Date object represents all aspects of a date and time from year to milliseconds. If arguments are provided when creating the Date object, the new object will contain the date specified, otherwise the object will be set to the current date. A Date object can also be created by calling Date as a function by excluding the new operator. The arguments and methods are listed in Table 6.24.

Caution

Navigator 3 and 4 return a string representation of the date rather ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.