![](http://images-20200215.ebookreading.net/24/3/3/9781498731454/9781498731454__start-programming-using__9781498731454__bg199.png)
JavaScript Reference
set[UTC]FullYear()
Syntax:
date .setFullYear(year [, month [, day ]])
date .setUTCFullYear(year [, month [, day ]])
This method sets the year field of date , using local (setFullYear()) or universal
(setUTCFulYear()) time. The year argument m ust be an integer specifying a full
year, and not an abbreviation such as 84 instead of the full 1984. Optionally, you ca n
specify month , which is an integer between 0 (January) and 11 ( D ecember), and day ,
which is an integer between 1 and 31. Note that square br ackets should not be used in
a method. T hey just indicate which arguments are optional.
set[UTC]Hours()
Syntax:
date .setHours(hours [, minutes [, seconds [, milliseconds ]]])
date .setUTCHours(hours [, minutes [, seconds [, milliseconds ]]])
This method sets the hours (and, optio nally, minutes, seconds, an d milliseconds) field
of date , using local (setHours()) or universal (setUTCHours()) time. The hours
argument sh ould be an integer betwe en 0 and 23, the minutes and seconds argu-
ments should be integers between 0 and 59, and the milliseconds argument should
be an integer between 0 and 999. Note that square brackets should not be used in a
method. They just indicate which arguments are optional.
set[UTC]Milliseconds()
Syntax:
date .setMilliseconds(milliseconds )
date .setUTCMilliseconds(milliseconds )
Allows you to set the milliseconds field of date , using local (setMilliseconds())
or universal (set UTCMilliseconds()) time. The milliseconds argument should
be an integer between 0 and 999.
set[UTC]Minutes()
Syntax:
date .setMinutes(minutes )
date .setUTCMinutes(minutes )
This method sets the minutes field of date , using local (setMinute s()) or universal
(setUTCMinutes()) time. The minutes argument should be an integer between 0
and 59.
E.6. Date (Core JavaScript) 389