The getYear() method in javascript returns the year in the format of 4 digits or 2 digits depending on the year used as argument. It is due to this inconsistency that it is not advisable to use the getYear() method. It is recommended you use the getFullYear() method instead. See Also: