本文整理汇总了PHP中Piwik_Site::getCreationDateFor方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_Site::getCreationDateFor方法的具体用法?PHP Piwik_Site::getCreationDateFor怎么用?PHP Piwik_Site::getCreationDateFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik_Site
的用法示例。
在下文中一共展示了Piwik_Site::getCreationDateFor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMinMaxDateAcrossWebsites
/**
* The Multisites reports displays the first calendar date as the earliest day available for all websites.
* Also, today is the later "today" available across all timezones.
* @param array $siteIds Array of IDs for each site being displayed.
* @return array of two Piwik_Date instances. First is the min-date & the second
* is the max date.
*/
private function getMinMaxDateAcrossWebsites($siteIds)
{
$now = Piwik_Date::now();
$minDate = null;
$maxDate = $now->subDay(1)->getTimestamp();
foreach ($siteIds as $idsite) {
// look for 'now' in the website's timezone
$timezone = Piwik_Site::getTimezoneFor($idsite);
$date = Piwik_Date::adjustForTimezone($now->getTimestamp(), $timezone);
if ($date > $maxDate) {
$maxDate = $date;
}
// look for the absolute minimum date
$creationDate = Piwik_Site::getCreationDateFor($idsite);
$date = Piwik_Date::adjustForTimezone(strtotime($creationDate), $timezone);
if (is_null($minDate) || $date < $minDate) {
$minDate = $date;
}
}
return array(Piwik_Date::factory($minDate), Piwik_Date::factory($maxDate));
}