function date_get_offset in Date 5
2 calls to date_get_offset()
- date_copy_convert_events in ./
date_copy.module - date_offset in ./
date.inc - A function to calculate offset using timezone.inc file
File
- ./
date_timezones.inc, line 207
Code
function date_get_offset($zid, $timestamp) {
$zones = date_get_timezones();
$zone = $zones[$zid];
if ($zone['dst_region']) {
// zone is a region which obeys dst, return correct offset
return date_is_dst($zone['dst_region'], $timestamp) ? $zone['offset_dst'] : $zone['offset'];
}
else {
// no dst offset for this region
return $zone['offset'];
}
}