Calendar file generation

I had a need to create ics files for a PHP project I was working on. I found a existing class that had most of what I needed and it was simple to modify it for the additional features I needed.

Giving credit where it is due: ICS.php (

Then I discovered that I had more than an occasional need to generate ics files outside of that project, so I decided to deploy a web service that I could call and a form that utilized that service.

The form is at It is rudimentary, it has the basic fields (title, description, start, end and location). It displays the result on the page and has a link to download it. Another (more complete) generator is here.

The service is at It has much more functionality and supports the following options:
It is called with a POST method and the payload is passed as a JSON object. E.g. { ‘summary’: ‘This is a test event’, ‘dtstart’: ’03-24-2018 10:15′, ‘dtend’: ’03-24-2018 11:15′, ‘location’: ‘My house’, ‘organizer’: ‘Roger Dodger’ }

The return is a JSON object: { ics, ‘ICS File Contents’ }

The resulting ics works with all calendars that I’ve tried: Google, Outlook and Apple. If you try it and it doesn’t work, let me know what platform and calendar and I’ll take a look when I get some free time.

Leave a Reply

Your email address will not be published. Required fields are marked *