Hi All
I'm trying to compare 2 dates using:
The above always returns "Not Approved"!!
How can i compare dates better?
Thanks
nick
I'm trying to compare 2 dates using:
Code:
$LEAVE_FIRSTDATE = date("d/m/Y",strtotime(MySQL_RESULT($SQL_Result, 0,"firstday_date")));
$LEAVE_ENDDATE = explode ("/",$LEAVE_FIRSTDATE);
$MNT = $LEAVE_ENDDATE[1];
$DAY = $LEAVE_ENDDATE[0];
$YEAR = $LEAVE_ENDDATE[2];
$LEAVE_ENDDATE = date("d/m/Y",mktime (0,0,0,$MNT,$DAY + $LEAVE_DAYS, $YEAR));
if ($LEAVE_APPROVED == 1) { $LEAVE_APPROVED = "Approved"; $L = 1;}
elseif (strtotime(date("d/m/Y")) >= strtotime($LEAVE_ENDDATE)) {$LEAVE_APPROVED = "Not Approved"; $L = 2;}
elseif (strtotime(date("d/m/Y")) < strtotime($LEAVE_ENDDATE)) {$LEAVE_APPROVED = "Waiting"; $L = 0;}
The above always returns "Not Approved"!!
How can i compare dates better?
Thanks
nick