src/DateTime/Date.php
public static function fromNativeDateTime(\DateTime $date)
    {
        $year  = \intval($date->format('Y'));
        $month = Month::fromNativeDateTime($date);
        $day   = \intval($date->format('d'));

        return new static(new Year($year), $month, new MonthDay($day));
    }
public static function fromNativeDateTime(\DateTime $date)
    {
        $year  = \intval($date->format('Y'));
        $month = Month::fromNativeDateTime($date);
        $day   = \intval($date->format('d'));

        return new static(new Year($year), $month, new MonthDay($day));
    }
public static function fromNativeDateTime ( \ DateTime $ date ) { $ year = \ intval ( $ date -> format ( 'Y' ) ) ; $ month = Month :: fromNativeDateTime ( $ date ) ; $ day = \ intval ( $ date -> format ( 'd' ) ) ; return new static ( new Year ( $ year ) , $ month , new MonthDay ( $ day ) ) ; }
Returns a new Date from a native PHP \DateTime

@param  \DateTime $date
@return Date
Returns a new Date from a native PHP \ DateTime