You are here

function date_get_gmt_diff_ts in Date 6.2

Same name and namespace in other branches
  1. 5.2 date_php4/date_php4.inc \date_get_gmt_diff_ts()

Get local time zone offset from GMT.

Return value

timezone offset in seconds

3 calls to date_get_gmt_diff_ts()
_date_date in date_php4/date_php4_lib.inc
Low level function to create date() for pre-1970 and post-2038 dates.
_date_getdate in date_php4/date_php4_lib.inc
Low-level function that returns the getdate() array for pre-1970 and post-2038 dates.
_date_mktime in date_php4/date_php4_lib.inc
Low level function to create mktime() for pre-1970 and post 2038 dates.

File

date_php4/date_php4.inc, line 977

Code

function date_get_gmt_diff_ts($timestamp, $timezone = NULL) {
  if ($timezone == 'UTC') {
    return 0;
  }
  elseif (empty($timezone)) {
    $timezone = date_default_timezone_name();
  }
  $date = new stdClass();
  $date->timestamp = $timestamp;
  $date->timezone = $timezone;
  return date_offset_get($date);
}