// Fix Date.get/setYear() (IE5-7) if ((new Date).getYear() > 1900) { Date.prototype.getYear = function() { return this.getFullYear() - 1900; }; Date.prototype.setYear = function(year) { return this.setFullYear(year + 1900); }; } // https://bugs.webkit.org/show_bug.cgi?id=9532 var _testDate = new Date(Date.UTC(2006, 1, 20)); _testDate.setUTCDate(15); if (_testDate.getUTCHours() != 0) { forEach.csv("FullYear,Month,Date,Hours,Minutes,Seconds,Milliseconds", function(type) { extend(Date.prototype, "setUTC" + type, function() { var value = this.base.apply(this, arguments); if (value >= 57722401000) { value -= 3600000; this.setTime(value); } return value; }); }); }