So, for instance, if you were write the following:
var today = new Date; alert(today.getYear());
You would end up seeing an alert box that showed 107 if you ran the script in FireFox. Interestingly enough in IE you would see 2007. I don’t know who is following the standard, and frankly I don’t care. Instead I just want to do it right and in this case you do so by using getFullYear which returns a 4 digit year value.
var today = new Date; alert(today.getFullYear());
This will return 2007 in IE, Firefox, and Opera.
Interesting consequence - if you use getYear()/setYear() to set a cookie expiration date in the past, it won’t matter to Firefox, since 108 (as opposed to 2008) is still in the past. Chrome is a little stricter.
Firefox’s implementation of getYear() is consistent with the ECMAScript definition for the function. It is IE that isn’t standards complaint.
Thanks for the solution.