To avoid "millennium bugs", take into account the following:
method returns the full four-digit year for the year 2000 and all subsequent years
The following code fragment sets the correct four-digit year in all browsers:
Better yet, instead of
theDate = new Date(); theYear = theDate.getYear(); if (theYear<1900) theYear=theYear+1900;
use the the
method. It is supported in all modern browsers – and consistently returns the four-digit year.