src/Google/AdsApi/AdManager/Util/v201805/AdManagerDateTimes.php
public static function toDateTimeString(
        AdManagerDateTime $adManagerDateTime,
        $timeZoneId = null
    ) {
        $dateTime = self::toDateTime($adManagerDateTime);
        if ($timeZoneId !== null) {
            $dateTime->setTimezone(new DateTimeZone($timeZoneId));
        }

        return $dateTime->format(DateTime::ATOM);
    }
public static function toDateTimeString(
        AdManagerDateTime $adManagerDateTime,
        $timeZoneId = null
    ) {
        $dateTime = self::toDateTime($adManagerDateTime);
        if ($timeZoneId !== null) {
            $dateTime->setTimezone(new DateTimeZone($timeZoneId));
        }

        return $dateTime->format(DateTime::ATOM);
    }
public static function toDateTimeString ( AdManagerDateTime $ adManagerDateTime , $ timeZoneId = null ) { $ dateTime = self :: toDateTime ( $ adManagerDateTime ) ; if ( $ timeZoneId !== null ) { $ dateTime -> setTimezone ( new DateTimeZone ( $ timeZoneId ) ) ; } return $ dateTime -> format ( DateTime :: ATOM ) ; }
Returns an ISO 8601 string representation of the specified Ad Manager
date time.

Optionally, you may specify the timezone you want to view the date time
in. By default the time zone from the Ad Manager date time is used.
For example, if the Ad Manager date time holds `11/29/2016 21:05:30
in GMT`, the result from this method with Europe/Paris as the new time
zone, would be `11/29/2016 22:05:30 in CET`. This is useful for
displaying Ad Manager date times in your network's time zone.
For example:

```
$timeZoneId = $networkService->getCurrentNetwork()->getTimeZone();
$dateTimeString = AdManagerDateTimes::toDateTimeString(
$adManagerDateTime,
$timeZoneId
);
```

@param AdManagerDateTime $adManagerDateTime
@param null|string $timeZoneId optional
@return string
Returns an ISO 8601 string representation of the specified Ad Manager date time .