1

Date1=23-3-2013

Date2=26-3-2013

How to compare above both date such as If Date2 >= Date1 Echo greater them equal to

Else

Echo not greater them equal to

Here greater does not means mathematically greater

1 Answers1

1

Use the function strtotime($date) Therefore, you would have something like:

if(strtotime($date1) < strtotime($date2)){
    echo Date 2 is greater than date 1;
}else{
    echo Date 1 is greater or equal than Date 2;
 }
auicsc
  • 297
  • 1
  • 3
  • 14