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


PHP Time::getAdjustedTime方法代碼示例

本文整理匯總了PHP中Time::getAdjustedTime方法的典型用法代碼示例。如果您正苦於以下問題:PHP Time::getAdjustedTime方法的具體用法?PHP Time::getAdjustedTime怎麽用?PHP Time::getAdjustedTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Time的用法示例。


在下文中一共展示了Time::getAdjustedTime方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_calendar_actual_date

/**
* Sets the 'actualDate' field of the MyCalendar object
* @param none
* @return datestamp of the viewed date
*/
function get_calendar_actual_date()
{
    if (isset($_GET['date'])) {
        $date_split = explode('-', $_GET['date']);
    } else {
        $date_split = explode('-', date('m-d-Y', Time::getAdjustedTime(mktime(), date('H') * 60)));
    }
    return mktime(0, 0, 0, $date_split[0], $date_split[1], $date_split[2]);
}
開發者ID:razagilani,項目名稱:srrs,代碼行數:14,代碼來源:rescalendar.php

示例2: formatReminder

 function formatReminder()
 {
     $builder = new StringBuilder();
     if ($this->_reservation->reminder_minutes_prior != 0) {
         $reminder_time = $this->_reservation->start + $this->_reservation->start * 60 - $this->_reservation->reminder_minutes_prior * 60;
         $adjusted = Time::getAdjustedTime($reminder_time);
         $builder->append(sprintf("DALARM:%sT%sZ\r\n", date('Ymd', $adjusted), date('His', $adjusted)));
     }
     return $builder->toString();
 }
開發者ID:razagilani,項目名稱:srrs,代碼行數:10,代碼來源:VCalReservationFormatter.php

示例3: formatSettings

 function formatSettings()
 {
     $builder = new StringBuilder();
     $builder->append("UID:{$this->_reservation->id}\r\n");
     $adjusted = Time::getAdjustedTime(mktime());
     $builder->append(sprintf("DTSTAMP:%sT%sZ\r\n", date('Ymd', $adjusted), date('His', $adjusted)));
     $adjusted_start = Time::getAdjustedMinutes($this->_reservation->start);
     $builder->append(sprintf("DTSTART:%sT%s%s00Z\r\n", date('Ymd', Time::getAdjustedDate($this->_reservation->start_date, $this->_reservation->start)), Time::getHours($adjusted_start), Time::getMinutes($adjusted_start)));
     $adjusted_end = Time::getAdjustedMinutes($this->_reservation->end);
     $builder->append(sprintf("DTEND:%sT%s%s00Z\r\n", date('Ymd', Time::getAdjustedDate($this->_reservation->end_date, $this->_reservation->end)), Time::getHours($adjusted_end), Time::getMinutes($adjusted_end)));
     $adjusted = Time::getAdjustedTime($this->_reservation->created);
     $builder->append(sprintf("CREATED:%sT%sZ\r\n", date('Ymd', $adjusted), date('His', $adjusted)));
     if (!empty($this->_reservation->modified)) {
         $adjusted = Time::getAdjustedTime($this->_reservation->modified);
         $builder->append(sprintf("LAST-MODIFIED:%sT%sZ\r\n", date('Ymd', $adjusted), date('His', $adjusted)));
     }
     return $builder->toString();
 }
開發者ID:razagilani,項目名稱:srrs,代碼行數:18,代碼來源:ICalReservationFormatter.php

示例4: printCalendar

 /**
  * Print the actual calendar and jump functions
  *
  * This function prints out the calendar and calls all
  * the associated functions to print the calendar,
  * links and forms used to jump to a new month
  *
  * (This is the only function that needs to be called
  * after a Calendar has been created)
  * @param none
  */
 function printCalendar($current_date)
 {
     $today = getdate(Time::getAdjustedTime(mktime()));
     $selected_date_array = getdate($current_date);
     $this->printCalendarBody($today, $selected_date_array);
     if ($this->isPopup) {
         $this->printJumpForm();
     }
 }
開發者ID:razagilani,項目名稱:srrs,代碼行數:20,代碼來源:Calendar.class.php

示例5: getAdjustedDate

 /**
  * Gets the timezone adjusted datestamp for the current user with 0 hour/minute/second
  * @param int $timestamp the timestamp to adjust
  * @param int $res_time the reservation starttime or endtime as minutes
  * @param bool $to_server_time if this is going to server time or user time
  * @return the timezone adjusted timestamp for the current user, or the server timestamp if user is not logged in
  */
 function getAdjustedDate($timestamp, $res_time = null, $to_server_time = false)
 {
     $tmp = getdate(Time::getAdjustedTime($timestamp, $res_time, $to_server_time));
     return mktime(0, 0, 0, $tmp['mon'], $tmp['mday'], $tmp['year']);
 }
開發者ID:razagilani,項目名稱:srrs,代碼行數:12,代碼來源:Time.class.php


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