mozilla

Revision 88403 of Date.prototype.getUTCFullYear()

  • Revision slug: JavaScript/Reference/Global_Objects/Date/getUTCFullYear
  • Revision title: getUTCFullYear
  • Revision id: 88403
  • Created:
  • Creator: Takenbot
  • Is current revision? No
  • Comment Reverted to earlier version; 9 words added, 5 words removed

Revision Content

 

Summary

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

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

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>
<h3 name="Summary"> Summary </h3>
<p>Returns the year in the specified date according to universal time.
</p>
<table class="fullwidth-table">
<tbody><tr>
<td class="header" colspan="2">Method of <a href="en/Core_JavaScript_1.5_Reference/Objects/Date">Date</a></td>
</tr>
<tr>
<td>Implemented in:</td>
<td>JavaScript 1.3</td>
</tr>
<tr>
<td>ECMA Version:</td>
<td>ECMA-262</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