if two date compare then follow following steps : 1-convert two date in same formate using date function, 2-convert date into time format using php function - function : strtotime() 3-then compare two date using if() condition, Eg: <?php # Variable :: $date1=date('Y m d H:i:s'); $date2=date('Y-M-d H:i:s'); # conver date into time formate ::- $date1time=strtotime($date1); $date2time=strtotime($date2); # if condtion compare two date :: if($date1time==$date2time) { echo 'two date are equal '; } else { echo 'two date are not equal '; }