本文整理汇总了PHP中XenForo_Locale::getTimeZoneOffset方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Locale::getTimeZoneOffset方法的具体用法?PHP XenForo_Locale::getTimeZoneOffset怎么用?PHP XenForo_Locale::getTimeZoneOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Locale
的用法示例。
在下文中一共展示了XenForo_Locale::getTimeZoneOffset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: verifyAndProcessingTimeinput
public function verifyAndProcessingTimeinput(XenForo_Controller $controller, $sorttime = '', $datepicker)
{
$sorttime = array_map('intval', explode(":", $sorttime));
if (count($sorttime) != 2) {
throw new XenForo_Exception("Missing agrument for create/edit event.");
return false;
}
$datepicker = XenForo_Locale::date($datepicker, 'd-m-Y');
$datepicker = array_map('intval', explode('-', $datepicker));
$gmmktime = gmmktime($sorttime[0], $sorttime[1], 0, $datepicker[1], $datepicker[0], $datepicker[2]);
return $gmmktime - XenForo_Locale::getTimeZoneOffset();
}
示例2: gmmktime
/**
* Get Unix timestamp in GMT for inputted date values.
*
* @param int|array $year in user timezone
* @param int $month in user timezone
* @param int $day in user timezone
* @param int $hour in user timezone
* @param int $minute in user timezone
* @param int $second in user timezone
* @param int|null $offset custom offset to override user's
*
* @return int timestamp in GMT
*/
public static function gmmktime($year, $month = 0, $day = 0, $hour = 0, $minute = 0, $second = 0, $offset = null)
{
if (is_array($year)) {
$args = func_get_args();
if (count($args) !== 1) {
return 0;
}
$values = $year;
$year = 0;
foreach (array('year', 'month', 'day', 'hour', 'minute', 'second', 'offset') as $key) {
if (isset($values[$key]) && is_int($values[$key])) {
${$key} = intval($values[$key]);
}
}
}
$timestamp = gmmktime($hour, $minute, $second, $month, $day, $year);
if ($offset === null) {
$offset = XenForo_Locale::getTimeZoneOffset();
}
return $timestamp - $offset;
}
示例3: prepareEvent
public function prepareEvent(array $event, array $team, array $category, array $viewingUser = null)
{
$this->standardizeViewingUserReference($viewingUser);
$event = $this->prepareEventTypePhrase($event);
if (isset($event['team_user_id'])) {
$event['teamInfo'] = array('team_id' => $event['team_id'], 'user_id' => $event['team_user_id'], 'username' => $event['team_username'], 'title' => $event['title']);
}
$begin = max(0, $event['begin_date'] + XenForo_Locale::getTimeZoneOffset());
$event['beginDate'] = date('H:i', $begin);
if ($event['end_date']) {
$end = max(0, $event['end_date'] + XenForo_Locale::getTimeZoneOffset());
$event['endDate'] = date('H:i', $end);
}
if ($team) {
$category = $category ? $category : $null;
$event['canEditEvent'] = $this->canEditEvent($event, $team, $category, $null, $viewingUser);
$event['canDeleteEvent'] = $this->canDeleteEvent($event, $team, $category, $null, $viewingUser);
$event['canComment'] = $this->canCommentOnEvent($event, $team, $category, $null, $viewingUser);
$event['canLikeEvent'] = $this->canLikeEvent($event, $team, $category, $null, $viewingUser);
} else {
$event['canEditEvent'] = false;
$event['canDeleteEvent'] = false;
$event['canComment'] = false;
$event['canLikeEvent'] = false;
}
$event['event_title'] = XenForo_Helper_String::censorString($event['event_title']);
$event['titleCensored'] = true;
$event['likeUsers'] = unserialize($event['like_users']);
return $event;
}
示例4: _getCacheId
protected function _getCacheId(array $widget, $positionCode, array $params, array $suffix = array())
{
$suffix[] = XenForo_Locale::getTimeZoneOffset();
return parent::_getCacheId($widget, $positionCode, $params, $suffix);
}