Hey guys. I am pulling a date out of a database that looks like "mm/dd/yy" and assigning it to a variable. I am also getting todays date via the date("m/d/y") fucntion and putting it into a variable.
So I am taking those two dates and comparing them to see if the date coming from the database is less than todays date like this ...
$estCompDate = $anyRow['NewEstDate'];///date coming from database
$today=date("m/d/y");//todays date
if($estCompDate<$today){
$bColor="#FF5454";
$fColor="#ffffff";
}
That seemed to work fine until the new year came around and now it is not working right. I assume that is becuase I am comparing a date to a string and since the new year flipped over the todays date is lower than the estCompDate that might be 11/23/07 for instance.
If that is correct then I need to know how to convert the date I am getting out of the database to a date variable and not a string.
Thanks!