setDtStart(new \DateTime('2012-12-24')); $vEvent->setDtEnd(new \DateTime('2012-12-24')); $vEvent->setNoTime(true); $vEvent->setSummary('Christmas'); $vEvent->setDescription('Happy Christmas!'); $vEvent->setDescriptionHTML('Happy Christmas!'); // add some location information for apple devices $vEvent->setLocation("Infinite Loop\nCupertino CA 95014", 'Infinite Loop', '37.332095,-122.030743'); // 3. Add event to calendar $vCalendar->addComponent($vEvent); // 4. Set headers header('Content-Type: text/calendar; charset=utf-8'); header('Content-Disposition: attachment; filename="cal.ics"'); // 5. Output echo $vCalendar->render();