Hi,
I have a site that allows holiday booking enquiries. I'm doing some validation on the dates entered and frankly I'm baffled. What I want to do is ensure Arrival and Departure Dates are greater than today's date and that Arrival date is not after Departure Date. All dates are entered in dd/mm/yyyy format. What I'm doing is running the Current Date, Arrival date and Departure Date through strtotime and then comparing the results, however I can't figure out why the following happens.
Code extract:
$curdate=date("d/m/Y");
$date1=strtotime($curdate);
$date2=strtotime($_POST[arrival]);
$date3=strtotime($_POST[depart]);
this is the result of an echo on all the above values :
today=12/09/2007 and 1197158400
arrival=11/09/2007 and 1194566400
depart= 14/08/2007 and 1202428800
The dates shown above are what's in $curdate and the $_POST values and the numbers are the strtotime results.
So, why does the Departure Date come back with a number greater than the others when the date is obviously before them?