You are here

function _date_ical_chooseOffset in Date 5

1 call to _date_ical_chooseOffset()
date_ical_import in ./date_ical.inc
Given the location of a valid iCalendar file, will return an array of event information

File

./date_ical.inc, line 344

Code

function _date_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 = _date_ical_tz($timezone)) {
        $offset = date('I', $time) ? _date_ical_calcString($tz->offset_dst) : _date_ical_calcString($tz->offset);
      }
      else {
        $offset = '+0000';
      }
  }
  return $offset;
}