本文整理汇总了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]);
}
示例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();
}
示例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();
}
示例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();
}
}
示例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']);
}