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;
    }