src/Google/AdsApi/AdManager/Util/v201805/AdManagerDateTimes.php
public static function fromDateTime(DateTime $dateTime)
    {
        $date = new Date();
        $date->setYear(intval($dateTime->format('Y')));
        $date->setMonth(intval($dateTime->format('m')));
        $date->setDay(intval($dateTime->format('d')));

        $result = new AdManagerDateTime();
        $result->setDate($date);
        $result->setHour(intval($dateTime->format('H')));
        $result->setMinute(intval($dateTime->format('i')));
        $result->setSecond(intval($dateTime->format('s')));
        $result->setTimeZoneID($dateTime->format('e'));

        return $result;
    }
public static function fromDateTime(DateTime $dateTime)
    {
        $date = new Date();
        $date->setYear(intval($dateTime->format('Y')));
        $date->setMonth(intval($dateTime->format('m')));
        $date->setDay(intval($dateTime->format('d')));

        $result = new AdManagerDateTime();
        $result->setDate($date);
        $result->setHour(intval($dateTime->format('H')));
        $result->setMinute(intval($dateTime->format('i')));
        $result->setSecond(intval($dateTime->format('s')));
        $result->setTimeZoneID($dateTime->format('e'));

        return $result;
    }
public static function fromDateTime ( DateTime $ dateTime ) { $ date = new Date ( ) ; $ date -> setYear ( intval ( $ dateTime -> format ( 'Y' ) ) ) ; $ date -> setMonth ( intval ( $ dateTime -> format ( 'm' ) ) ) ; $ date -> setDay ( intval ( $ dateTime -> format ( 'd' ) ) ) ; $ result = new AdManagerDateTime ( ) ; $ result -> setDate ( $ date ) ; $ result -> setHour ( intval ( $ dateTime -> format ( 'H' ) ) ) ; $ result -> setMinute ( intval ( $ dateTime -> format ( 'i' ) ) ) ; $ result -> setSecond ( intval ( $ dateTime -> format ( 's' ) ) ) ; $ result -> setTimeZoneID ( $ dateTime -> format ( 'e' ) ) ; return $ result ; }
Creates a Ad Manager date time from a PHP date time.

@param DateTime $dateTime
@return AdManagerDateTime
Creates a Ad Manager date time from a PHP date time .