本文整理汇总了PHP中DateTimeUtils::FromDfpDateTime方法的典型用法代码示例。如果您正苦于以下问题:PHP DateTimeUtils::FromDfpDateTime方法的具体用法?PHP DateTimeUtils::FromDfpDateTime怎么用?PHP DateTimeUtils::FromDfpDateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTimeUtils
的用法示例。
在下文中一共展示了DateTimeUtils::FromDfpDateTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testFromDfpDateTime
/**
* @covers DateTimeUtils::FromDfpDateTime
*/
public function testFromDfpDateTime()
{
$this->assertEquals($this->dateTime1, DateTimeUtils::FromDfpDateTime($this->dfpDateTime1));
$this->assertEquals($this->dateTime2, DateTimeUtils::FromDfpDateTime($this->dfpDateTime2));
$this->assertEquals($this->dateTime3, DateTimeUtils::FromDfpDateTime($this->dfpDateTime3));
}
示例2: fopen
$fp = fopen($fn, "a");
fwrite($fp, implode(',', array('orderId', 'orderName', 'lineItemId', 'lineItemName', 'externalId', 'creationDateTime', 'startDateTime', 'endDateTime', 'priority', 'costType', 'lineItemType', 'impressionsDelivered', 'clicksDelivered', 'expectedDeliveryPercentage', 'actualDeliveryPercentage', 'status', 'notes', 'isMissingCreatives', 'primaryGoalType', 'primaryGoalUnitType', 'primaryGoalUnits', 'targetingGeo', 'targetingExcludedAdunits', 'targetingBrowser', 'targetingCategory', 'targetingDevice', 'targetingOs', 'targetingOsVersion', 'targetingCustom', 'frequencyCaps', 'targetingPlatform')) . "\n");
do {
// Get line items by statement.
$page = $lineItemService->getLineItemsByStatement($statementBuilder->ToStatement());
// Save results.
if (isset($page->results)) {
$totalResultSetSize = $page->totalResultSetSize;
$i = $page->startIndex;
foreach ($page->results as $lineItem) {
//print_r(get_object_vars($lineItem)); exit;
//print_r($lineItem->targeting);
if (is_null($lineItem->creationDateTime)) {
$creationDateTimeString = null;
} else {
$creationDateTime = $dateTimeUtils->FromDfpDateTime($lineItem->creationDateTime);
$creationDateTime->setTimezone(new DateTimeZone('Europe/Amsterdam'));
$creationDateTimeString = $creationDateTime->format('Y-m-d H:i:s');
}
if (is_null($lineItem->startDateTime)) {
$startDateTimeString = null;
} else {
$startDateTime = $dateTimeUtils->FromDfpDateTime($lineItem->startDateTime);
$startDateTime->setTimezone(new DateTimeZone('Europe/Amsterdam'));
$startDateTimeString = $startDateTime->format('Y-m-d H:i:s');
}
if (is_null($lineItem->endDateTime)) {
$endDateTimeString = null;
} else {
$endDateTime = $dateTimeUtils->FromDfpDateTime($lineItem->endDateTime);
$endDateTime->setTimezone(new DateTimeZone('Europe/Amsterdam'));