Learn to read, maybe ? Seriously, you have a line that says : if ($year < 100) {$year += 1900;} Replace that with : $year += 1900;

added to reflect my wonder at the fact that abockover pinpointed the right subroutine where the problem was, but failed to notice that there was only one line there that contains the number 100 and adds 1900 in some cases.