Answers for "php check if date is bigger than today"

PHP
0

php check if date is bigger than today

<?php
 $date_now = new DateTime();
 $date2    = new DateTime("01/02/2016");

if ($date_now > $date2) {
    echo 'greater than';
}else{
    echo 'Less than';
}
Posted by: Guest on August-10-2020
0

php check if date is bigger than today

<?php
 $date_now = date("Y-m-d"); // this format is string comparable

if ($date_now > '2016-01-02') {
    echo 'greater than';
}else{
    echo 'Less than';
}
Posted by: Guest on August-10-2020

Code answers related to "php check if date is bigger than today"

Browse Popular Code Answers by Language