public static function GetFormattedServerDate($text) { if (preg_match('/(\\+|-)([0-9]{2}):?([0-9]{2})([0-9]{2})?$/', $text, $match)) { $text = substr($text, 0, -strlen($match[0])); } $date = CDavICalendarTimeZone::ParseDateTime($text, false, null); return date($GLOBALS["DB"]->DateFormatToPHP(FORMAT_DATE), $date); }