You are here

function _ical_chooseOffset in Event 5

1 call to _ical_chooseOffset()
ical_import in ./ical.inc
Given the location of a valide iCalendar file, will return an array of event information

File

./ical.inc, line 319
API for event import/export in iCalendar format as outlined in Internet Calendaring and Scheduling Core Object Specification http://www.ietf.org/rfc/rfc2445.txt

Code

function _ical_chooseOffset($time, $timezone) {
  if (!isset($timezone)) {
    $timezone = '';
  }
  switch ($timezone) {
    case '':
      $offset = 'none';
      break;
    case 'Same as Server':
      $offset = date('O', $time);
      break;
    default:
      if ($tz = _ical_tz($timezone)) {
        $offset = date('I', $time) ? $tz->offset_dst : $tz->offset;
      }
      else {
        $offset = '+0000';
      }
  }
  return $offset;
}