Visit Mozilla.org

Core JavaScript 1.5 Reference:Global Objects:Date:getUTCFullYear

From MDC


Contents

[edit] Summary

Returns the year in the specified date according to universal time.

Method of Date
Implemented in: JavaScript 1.3
ECMA Version: ECMA-262

[edit] Syntax

getUTCFullYear()

[edit] Parameters

None.

[edit] Description

The value returned by getUTCFullYear is an absolute number that is compliant with year-2000, for example, 1995.

[edit] Examples

[edit] Example: Using getUTCFullYear

The following example assigns the four-digit value of the current year to the variable yr.

var yr;
Today = new Date();
yr = Today.getUTCFullYear(); 

[edit] See Also

getFullYear, setFullYear