public static function create(
        int $year,
        int $month,
        int $day,
        int $hour,
        int $minute,
        int $second,
        ?string $timezone = null
    ): DateTime {
        $timezone = $timezone ?: date_default_timezone_get();
        assert(Validate::isTimezone($timezone), sprintf('Invalid timezone: %s', $timezone));

        return new static(
            Date::create($year, $month, $day),
            Time::create($hour, $minute, $second),
            Timezone::create($timezone)
        );
    }
public static function create(
        int $year,
        int $month,
        int $day,
        int $hour,
        int $minute,
        int $second,
        ?string $timezone = null
    ): DateTime {
        $timezone = $timezone ?: date_default_timezone_get();
        assert(Validate::isTimezone($timezone), sprintf('Invalid timezone: %s', $timezone));

        return new static(
            Date::create($year, $month, $day),
            Time::create($hour, $minute, $second),
            Timezone::create($timezone)
        );
    }
public static function create ( int $ year , int $ month , int $ day , int $ hour , int $ minute , int $ second , ? string $ timezone = null ) : DateTime { $ timezone = $ timezone ? : date_default_timezone_get ( ) ; assert ( Validate :: isTimezone ( $ timezone ) , sprintf ( 'Invalid timezone: %s' , $ timezone ) ) ; return new static ( Date :: create ( $ year , $ month , $ day ) , Time :: create ( $ hour , $ minute , $ second ) , Timezone :: create ( $ timezone ) ) ; }
Creates instance from date and time values

@param int         $year     The year
@param int         $month    The month
@param int         $day      The day
@param int         $hour     The hour
@param int         $minute   The minute
@param int         $second   The second
@param string|null $timezone The timezone string or null for default

@return DateTime

@throws DomainException When the date/time is not valid
Creates instance from date and time values