![]() |
VOOZH | about |
JavaScript date.getYear() is used to get the year on a specified date according to universal time. The year we get from the method getYear() is the current year minus 1900.
date.getYear();Example 1: This example returns the year of the specified date according to universal time.
Output:
The value returned by getYear() method: 119Example 2: This example only sends the year to the constructor.
Output:
The value returned by getYear() method: 100Example 3: Here, we pass a full date to the constructor, the format of the date is month-day-year-time, such as October 15, 2010, 02:05:32.
The value returned by getYear() method: 110