You are here

function date_time in Date 5

Implementation of time() adjusted for the current site and user.

Parameters

$offset - optional method to force time to a specific offset:

Return value

integer timestamp

2 calls to date_time()
date_ical_parse_duration in ./date_api_ical.inc
Parse the duration of the event.
theme_date_format_interval in ./date.module
Theme a format interval for a date element

File

./date.inc, line 175
Date/time API functions

Code

function date_time($offset = NULL) {
  global $user;
  if ($offset) {
    return time() - date("Z") + offset;
  }
  elseif (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
    return time() - date("Z") + $user->timezone;
  }
  else {
    return time() - date("Z") + variable_get('date_default_timezone', 0);
  }
}