當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XenForo_Locale::getTimeZoneOffset方法代碼示例

本文整理匯總了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();
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:12,代碼來源:Setup.php

示例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;
 }
開發者ID:maitandat1507,項目名稱:DevHelper,代碼行數:34,代碼來源:DateTime.php

示例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;
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:30,代碼來源:Event.php

示例4: _getCacheId

 protected function _getCacheId(array $widget, $positionCode, array $params, array $suffix = array())
 {
     $suffix[] = XenForo_Locale::getTimeZoneOffset();
     return parent::_getCacheId($widget, $positionCode, $params, $suffix);
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:5,代碼來源:Birthday.php


注:本文中的XenForo_Locale::getTimeZoneOffset方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。