function testGetDateTimeDateDATEReverse()
 {
     $elem = new Sabre_VObject_Property_MultiDateTime('DTSTART', '19850704,19860704');
     $this->assertEquals(Sabre_VObject_Property_DateTime::DATE, $elem->getDateType());
     $dt = $elem->getDateTimes();
     $this->assertEquals('1985-07-04 00:00:00', $dt[0]->format('Y-m-d H:i:s'));
     $this->assertEquals('1986-07-04 00:00:00', $dt[1]->format('Y-m-d H:i:s'));
 }
 /**
  * @depends testValues
  */
 function testComplexExclusions()
 {
     $ev = new Sabre_VObject_Component('VEVENT');
     $ev->UID = 'bla';
     $ev->RRULE = 'FREQ=YEARLY;COUNT=10';
     $dtStart = new Sabre_VObject_Property_DateTime('DTSTART');
     $tz = new DateTimeZone('Canada/Eastern');
     $dtStart->setDateTime(new DateTime('2011-01-01 13:50:20', $tz), Sabre_VObject_Property_DateTime::LOCALTZ);
     $exDate1 = new Sabre_VObject_Property_MultiDateTime('EXDATE');
     $exDate1->setDateTimes(array(new DateTime('2012-01-01 13:50:20', $tz), new DateTime('2014-01-01 13:50:20', $tz)), Sabre_VObject_Property_DateTime::LOCALTZ);
     $exDate2 = new Sabre_VObject_Property_MultiDateTime('EXDATE');
     $exDate2->setDateTimes(array(new DateTime('2016-01-01 13:50:20', $tz)), Sabre_VObject_Property_DateTime::LOCALTZ);
     $ev->add($dtStart);
     $ev->add($exDate1);
     $ev->add($exDate2);
     $vcal = Sabre_VObject_Component::create('VCALENDAR');
     $vcal->add($ev);
     $it = new Sabre_VObject_RecurrenceIterator($vcal, (string) $ev->uid);
     $this->assertEquals('yearly', $it->frequency);
     $this->assertEquals(1, $it->interval);
     $this->assertEquals(10, $it->count);
     $max = 20;
     $result = array();
     foreach ($it as $k => $item) {
         $result[] = $item;
         $max--;
         if (!$max) {
             break;
         }
     }
     $this->assertEquals(array(new DateTime('2011-01-01 13:50:20', $tz), new DateTime('2013-01-01 13:50:20', $tz), new DateTime('2015-01-01 13:50:20', $tz), new DateTime('2017-01-01 13:50:20', $tz), new DateTime('2018-01-01 13:50:20', $tz), new DateTime('2019-01-01 13:50:20', $tz), new DateTime('2020-01-01 13:50:20', $tz)), $result);
 }