You are here

function _ical_choose_offset in Event 5.2

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

File

./ical.inc, line 313
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_choose_offset($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;
}