You are here

function _event_user_time in Event 5.2

Same name and namespace in other branches
  1. 5 event.module \_event_user_time()

Returns local date + time based on the user or site time zone.

Return value

array

11 calls to _event_user_time()
event_block_upcoming in ./event.module
Creates a block that contains upcoming events.
event_cron in ./event.module
Implementation of hook_cron
event_feed in ./event.module
Url wrapper function for rss feeds
event_form_alter in ./event.module
Implementation of hook_form_alter
event_ical in ./event.module
Url wrapper function for ical feeds

... See full list

File

./event.module, line 1448

Code

function _event_user_time() {
  global $user;
  if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
    $time = time() - date("Z") + $user->timezone;
  }
  else {
    $time = time() - date("Z") + variable_get('date_default_timezone', 0);
  }
  $return = explode('|', date('Y|m|d|H|i|s', $time));
  return array(
    'year' => $return[0],
    'month' => $return[1],
    'day' => $return[2],
    'hour' => $return[3],
    'minute' => $return[4],
    'second' => $return[5],
  );
}