I’ve a wierd problem whereby the comparison of 2 dates does not compare accurately.
The signup date(eg. 16-10-2012) is earlier than today’s date(eg. 05-11-2012) and should print “signup date is earlier than today date”. But it keeps going to the else statement printing “signup date is later than today date”.
I don’t see the problem. Can anyone help?
echo $signup = $model->signup_date; //formatted in model such that the date format is 'd-m-Y' (eg. 16-10-2012)
echo "<br />";
echo $today = date('d-m-Y'); //get today date (eg. 05-11-2012)
echo "<br />";
if($signup<$today){
echo "signup date is earlier than today date";
}else{
echo "signup date is later than today date";
}