Page 1 of 1

compare two date

Posted: Sat Mar 25, 2006 10:59 pm
by amain
I want the coding to compare between two date
If date one exceed date two then anything..

Posted: Sat Mar 25, 2006 11:09 pm
by feyd

Code: Select all

if($date1 > $date2)
{
// $date1 "exceeds" $date2
}

Posted: Sun Mar 26, 2006 12:42 am
by s.dot
I believe the dates would have to be timestamps before you could compare them. If they're not, use strtotime() on them and then compare