Timestamp Issue

I’ve been using this code off and on for months now and suddenly having issues with this code:

function compareDates (date1 : Date, date2 : Date) : Number
{
var date1Timestamp : Number = date1.getTime ();
var date2Timestamp : Number = date2.getTime ();

var result : Number = -1;

if (date1Timestamp == date2Timestamp)
{
    result = 0;
}
else if (date1Timestamp > date2Timestamp)
{
    result = 1;
}

return result;

}

dateBefore.visible = compareDates(new Date(), new Date(2011, 04, 19)) <= 0; //NB: Months are 0-based.
dateAfter.visible = !dateBefore.visible;

If I change the date to (2011, 01, 19) it works fine, but with the date needed it will not work. I double checked my system preferences and they are fine.

Any suggestions would be greatly appreciated.

Thx,

S