fromDateTime()
fromDateTime(\DateTime $dateTime): \Google\AdsApi\AdManager\v202105\DateTime
Creates a Ad Manager date time from a PHP date time.
Parameters
\DateTime | $dateTime |
Static utility methods for working with Ad Manager `DateTime` objects.
toDateTimeString(\Google\AdsApi\AdManager\v202105\DateTime $adManagerDateTime,null|string $timeZoneId = null): string
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
);
\Google\AdsApi\AdManager\v202105\DateTime | $adManagerDateTime | |
null|string | $timeZoneId | optional |