Date.prototype.getUTCFullYear()

  • Revision slug: JavaScript/Reference/Global_Objects/Date/getUTCFullYear
  • Revision title: getUTCFullYear
  • Revision id: 88402
  • Created:
  • Creator: evilpie
  • Is current revision? No
  • Comment 5 words added, 9 words removed

Revision Content

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

Method of Date
Implemented in 1.3
ECMAScript Edition ECMAScript 1st Edition

Syntax

getUTCFullYear()

Parameters

None.

Description

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

Examples

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(); 

See Also

getFullYear, setFullYear

{{ languages( { "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/Date/getUTCFullYear" } ) }}

Revision Source

<p>
</p>
<p>Returns the year in the specified date according to universal time.
</p>
<table class="standard-table"> <thead> <tr> <th class="header" colspan="2">Method of <a href="/en/JavaScript/Reference/Global_Objects/Date"><code>Date</code></a></th> </tr> </thead> <tbody> <tr> <td>Implemented in</td> <td>1.3</td> </tr> <tr> <td>ECMAScript Edition</td> <td>ECMAScript 1st Edition</td> </tr> </tbody>
</table> <h3 name="Syntax"> Syntax </h3>
<p><code>
getUTCFullYear()
</code>
</p>
<h3 name="Parameters"> Parameters </h3>
<p>None.
</p>
<h3 name="Description"> Description </h3>
<p>The value returned by <code>getUTCFullYear</code> is an absolute number that is compliant with year-2000, for example, 1995.
</p>
<h3 name="Examples"> Examples </h3>
<h4 name="Example:_Using_getUTCFullYear"> Example: Using <code>getUTCFullYear</code> </h4>
<p>The following example assigns the four-digit value of the current year to the variable <code>yr</code>.
</p>
<pre>var yr;
Today = new Date();
yr = Today.getUTCFullYear(); 
</pre>
<h3 name="See_Also"> See Also </h3>
<p><a href="en/Core_JavaScript_1.5_Reference/Objects/Date/getFullYear">getFullYear</a>,
<a href="en/Core_JavaScript_1.5_Reference/Objects/Date/setFullYear">setFullYear</a>
</p>{{ languages( { "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/Date/getUTCFullYear" } ) }}
Revert to this revision