JavaScript getYear Method



The getYear method is obsolete and has been replaced by the getFullYear method.

Although the getYear method used to return the last two digits of the year of the point in time stored in a Date object, nowadays it works in different ways in different browsers.

The right way to get the year is with getFullYear, which returns all the digits of the year of a point in time stored in a Date object.

To see a description of the getFullYear method, click here.





JavaScript Manual >> Date Object >> getYear Method





© Copyright 2010-2016 ROM Cartridge