1<?php
2 $date_now = new DateTime();
3 $date2 = new DateTime("01/02/2016");
4
5if ($date_now > $date2) {
6 echo 'greater than';
7}else{
8 echo 'Less than';
9}
1<?php
2 $date_now = date("Y-m-d"); // this format is string comparable
3
4if ($date_now > '2016-01-02') {
5 echo 'greater than';
6}else{
7 echo 'Less than';
8}