You are here

function _date_ical_calcOffset in Date 5

Convert a formatted timezone offset string the offset value in seconds. i.e. +0300 becomes +10800.

1 call to _date_ical_calcOffset()
_date_ical_calcTime in ./date_ical.inc
Convert time from one timezone to another.

File

./date_ical.inc, line 397

Code

function _date_ical_calcOffset($offset_str) {
  $sign = substr($offset_str, 0, 1);
  $hours = substr($offset_str, 1, 2);
  $mins = substr($offset_str, 3, 2);
  $secs = (int) $hours * 3600 + (int) $mins * 60;
  if ($sign == '-') {
    $secs = 0 - $secs;
  }
  return $secs;
}