function _event_mktime in Event 5
Formats local time values to GMT timestamp using time zone offset supplied. All time values in the database are GMT and translated here prior to insertion.
Time zone settings are applied in the following order: 1. If supplied, time zone offset is applied 2. If user time zones are enabled, user time zone offset is applied 3. If neither 1 nor 2 apply, the site time zone offset is applied
Parameters
$format The date() format to apply to the timestamp.:
$timestamp The GMT timestamp value.:
$offset Time zone offset to apply to the timestamp.:
Return value
gmdate() formatted date value
Related topics
3 calls to _event_mktime()
- event_calendar_data in ./
event.module - Returns an array of nodes that occur on a given date. Handles content type and taxonomy filters.
- event_validate_form_date in ./
event.module - Validates the start and end times in a node form submission.
- theme_event_calendar_date_box in ./
event.theme - Format an date's day box in a calendar
File
- ./
event.module, line 1408
Code
function _event_mktime($hour, $minute, $second, $month, $day, $year, $offset = NULL) {
global $user;
$timestamp = gmmktime($hour, $minute, $second, $month, $day, $year);
if (isset($offset)) {
return $timestamp - $offset;
}
elseif (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone) && variable_get('event_timezone_display', 'event') == 'user') {
return $timestamp - $user->timezone;
}
else {
return $timestamp - variable_get('date_default_timezone', 0);
}
}