Hi all. Quick question about date comparisons:
I have the following code:
$err .= date("Y-n-j",strtotime($event_start_date)) < date("Y-n-j",time()) ? "<li class=\"err\">The start date you entered has already passed</li><br>": "";
This simply compares two dates, and writes an error if it returns true.
However, given that it's checking to see if 2002-8-10 is less than 2002-8-8 I cannot figure out why it's writing the error, when clearly 2002-8-8 arrives before 2002-8-10, and hence the above code should return false.
Now, the weird thing is that it happens no matter what day I select between now and Aug. 31, and as soon as I hit Sept. 1 it works fine.
Anyone have any ideas what could be causing this?
Thanks in advance,
P.