当前位置: 首页>>代码示例>>PHP>>正文


PHP SugarDateTime::format方法代码示例

本文整理汇总了PHP中SugarDateTime::format方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarDateTime::format方法的具体用法?PHP SugarDateTime::format怎么用?PHP SugarDateTime::format使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SugarDateTime的用法示例。


在下文中一共展示了SugarDateTime::format方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 function __construct($view, $time_arr = array())
 {
     global $current_user, $timedate;
     global $sugar_config;
     if ($current_user->getPreference('time')) {
         $time = $current_user->getPreference('time');
     } else {
         $time = $sugar_config['default_time_format'];
     }
     if (substr_count($time, 'h') > 0) {
         $this->use_24 = 0;
     }
     if (!($view == 'day' || $view == 'month' || $view == 'year' || $view == 'week' || $view == 'shared')) {
         sugar_die("view needs to be one of: day, week, month, shared, or year");
     }
     $this->view = $view;
     if (isset($time_arr['activity_focus'])) {
         $this->activity_focus = new CalendarActivity($time_arr['activity_focus']);
         $this->date_time = $this->activity_focus->start_time;
     } else {
         if (!empty($time_arr)) {
             // FIXME: what format?
             $this->date_time = $timedate->fromTimeArray($time_arr);
         } else {
             $this->date_time = $timedate->getNow();
         }
     }
     $timedate->tzUser($this->date_time, $current_user);
     $GLOBALS['log']->debug("CALENDATE: " . $this->date_time->format('r'));
     $this->create_slices();
 }
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:31,代码来源:Calendar.php

示例2: getUtcDateTime

 /**
  * Gets a UTC formatted string from the given dateTime
  *
  * @param SugarDateTime $dateTime the dateTime to format
  * @return string the UTC formatted dateTime
  */
 protected function getUtcDateTime($dateTime)
 {
     return $dateTime->format(self::UTC_FORMAT);
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:10,代码来源:iCal.php

示例3: empty

 /**
  * @deprecated for public use
  * handles offset values for Timezones and DST
  * @param	$date	     string		date/time formatted in user's selected format
  * @param	$format	     string		destination format value as passed to PHP's date() funtion
  * @param	$to		     boolean
  * @param	$user	     object		user object from which Timezone and DST
  * @param	$usetimezone string		timezone name
  * values will be derived
  * @return 	 string		date formatted and adjusted for TZ and DST
  */
 function handle_offset($date, $format, $to = true, $user = null, $usetimezone = null)
 {
     $tz = empty($usetimezone) ? $this->_getUserTZ($user) : new DateTimeZone($usetimezone);
     $dateobj = new SugarDateTime($date, $to ? self::$gmtTimezone : $tz);
     $dateobj->setTimezone($to ? $tz : self::$gmtTimezone);
     return $dateobj->format($format);
     //        return $this->_convert($date, $format, $to ? self::$gmtTimezone : $tz, $format, $to ? $tz : self::$gmtTimezone);
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:19,代码来源:TimeDate.php


注:本文中的SugarDateTime::format方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。