public static function parseDateTime($time, $format = null)
    {
        $dateFormat = $format ?: static::$_toStringFormat;
        $timeFormat = $pattern = null;

        if (is_array($dateFormat)) {
            list($newDateFormat, $timeFormat) = $dateFormat;
            $dateFormat = $newDateFormat;
        } else {
            $pattern = $dateFormat;
            $dateFormat = null;
        }

        if (static::$_isDateInstance === null) {
            static::$_isDateInstance =
                is_subclass_of(static::class, ChronosDate::class) ||
                is_subclass_of(static::class, MutableDate::class);
        }

        $defaultTimezone = static::$_isDateInstance ? 'UTC' : date_default_timezone_get();
        $formatter = datefmt_create(
            static::$defaultLocale,
            $dateFormat,
            $timeFormat,
            $defaultTimezone,
            null,
            $pattern
        );
        $time = $formatter->parse($time);
        if ($time !== false) {
            $result = new static('@' . $time);

            return static::$_isDateInstance ? $result : $result->setTimezone($defaultTimezone);
        }

        return null;
    }