public static function time(string $time = 'now', string $format = null): \DateTimeInterface {
        $timezone = new \DateTimeZone('utc');

        if (is_null($format)) {
            $date = new \DateTime($time, $timezone);
        } else {
            $date = \DateTime::createFromFormat($format, $time, $timezone);
        }

        return $date;
    }
public static function time(string $time = 'now', string $format = null): \DateTimeInterface {
        $timezone = new \DateTimeZone('utc');

        if (is_null($format)) {
            $date = new \DateTime($time, $timezone);
        } else {
            $date = \DateTime::createFromFormat($format, $time, $timezone);
        }

        return $date;
    }
public static function time ( string $ time = 'now' , string $ format = null ) : \ DateTimeInterface { $ timezone = new \ DateTimeZone ( 'utc' ) ; if ( is_null ( $ format ) ) { $ date = new \ DateTime ( $ time , $ timezone ) ; } else { $ date = \ DateTime :: createFromFormat ( $ format , $ time , $ timezone ) ; } return $ date ; }
Get the time

@param string $time
@param string $format
@return \DateTimeInterface
Get the time