You are here

function _quiz_mktime in Quiz 5

Same name and namespace in other branches
  1. 8.4 quiz_datetime.inc \_quiz_mktime()
  2. 5.2 quiz_datetime.inc \_quiz_mktime()
  3. 6.6 quiz_datetime.inc \_quiz_mktime()
  4. 6.2 quiz_datetime.inc \_quiz_mktime()
  5. 6.3 quiz_datetime.inc \_quiz_mktime()
  6. 6.4 quiz_datetime.inc \_quiz_mktime()
  7. 6.5 quiz_datetime.inc \_quiz_mktime()
  8. 7 quiz_datetime.inc \_quiz_mktime()
  9. 7.4 quiz_datetime.inc \_quiz_mktime()

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

1 call to _quiz_mktime()
quiz_translate_form_date in ./quiz_datetime.inc
Handles the start and end times in a node form submission.

File

./quiz_datetime.inc, line 44

Code

function _quiz_mktime($hour, $minute, $second, $month, $day, $year, $offset = NULL) {
  global $user;

  //print $user->timezone. " and ". variable_get('date_default_timezone', 0);
  $timestamp = gmmktime($hour, $minute, $second, $month, $day, $year);
  if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
    return $timestamp - $user->timezone;
  }
  else {
    return $timestamp - variable_get('date_default_timezone', 0);
  }
}