src/Helper.php
public static function compareDatetime($a, $b)
    {
        $timea = strtotime($a);
        $timeb = strtotime($b);

        if ($timea === false || $timeb === false) {
            return false;
        }

        if ($timea > $timeb) {
            return 1;
        } elseif ($timea < $timeb) {
            return -1;
        }

        return 0;
    }
public static function compareDatetime($a, $b)
    {
        $timea = strtotime($a);
        $timeb = strtotime($b);

        if ($timea === false || $timeb === false) {
            return false;
        }

        if ($timea > $timeb) {
            return 1;
        } elseif ($timea < $timeb) {
            return -1;
        }

        return 0;
    }
public static function compareDatetime ( $ a , $ b ) { $ timea = strtotime ( $ a ) ; $ timeb = strtotime ( $ b ) ; if ( $ timea === false || $ timeb === false ) { return false ; } if ( $ timea > $ timeb ) { return 1 ; } elseif ( $ timea < $ timeb ) { return - 1 ; } return 0 ; }
compare two datetime

@param string $a yyyy-mm-dd hh:ii:ss e.g.
@param string $b yyyy-mm-dd hh:ii:ss e.g.
@return int|bool return false if $a or $b is not valid
compare two datetime