
Date
JavaScript Pocket Reference
|
61
Methods
createHTMLDocument(title)
Creates and returns a new HTML Document object and
populates it with
<html>, <head>, <title>, and <body>
elements. title is the text to appear in the <title> element.
DOM Level 2.
hasFeature(feature, version)
Returns true if the implementation supports the specified
version of the specified feature, or
false otherwise. If no
version number is specified, the method returns
true if the
implementation completely supports any version of the speci-
fied feature. Both
feature and version are strings; for
example, “core”, “1.0” or “html”, “2.0”.
Date
manipulates dates and times
Core JavaScript 1.0; JScript 1.0; ECMA v1
Constructor
new Date(); // current time
new Date(milliseconds) // from timestamp
new Date(datestring); // parse string
new Date(year, month, day,
hours, minutes, seconds, ms)
With no arguments, the Date() constructor creates a Date object
set to the current date and time. When one numeric argument is
passed, it is taken as the internal numeric representation of the
date in milliseconds, as returned by the
getTime() method. When
one string argument is passed, it is taken as a string representa-
tion of a date. Otherwise, the constructor is passed between two
and seven numeric arguments that specify the individual fields of
the local date and time. All but the first two arguments—the year
and month fields—are optional. See the static
Date.UTC( ...