Exemplo n.º 1
0
 /**
  * Export a DateTime field.
  */
 function _exportDateTime($value)
 {
     $temp = array();
     if (!is_object($value) && !is_array($value)) {
         $tz = date('O', $value);
         $TZOffset = 3600 * substr($tz, 0, 3) + 60 * substr(date('O', $value), 3, 2);
         $value -= $TZOffset;
         $temp['zone'] = 'UTC';
         $temp['year'] = date('Y', $value);
         $temp['month'] = date('n', $value);
         $temp['mday'] = date('j', $value);
         $temp['hour'] = date('G', $value);
         $temp['minute'] = date('i', $value);
         $temp['second'] = date('s', $value);
     } else {
         $dateOb = new \TYPO3\CMS\Cal\Model\CalDate($value);
         return ICalendar::_exportDateTime($dateOb->timestamp());
     }
     return ICalendar::_exportDate($temp) . 'T' . ICalendar::_exportTime($temp);
 }