A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/Date/getFullYear below:

getFullYear ยท WebPlatform Docs

getFullYear Summary

Gets the year, using local time.

Syntax
dateObj.getFullYear()
Return Value

The year as a four-digit number. For example, the year 1976 is returned as 1976. Years specified as two digits in the Date constructor or in setFullYear are assumed to be in the twentieth century, so given "5/14/12", getFullYear returns "1912".

Examples

The following example illustrates the use of the getFullYear method.

var date = new Date("1/1/01");
 document.write(date.getFullYear());

 
Remarks

The required dateObj reference is a Date object. To get the year using Universal Coordinated Time (UTC), use the getUTCFullYear method.

See also Other articles Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4