当前位置: 首页>>代码示例>>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;未经允许,请勿转载。