www.jlion.com

Monday, June 09, 2008

I'm now about a fifth of the way into the audiobook version of Frank Herbert's Dune. This is a book I read as a teenager. I had forgotten how engaging it is.

Are you creating a calendar for your web site? Want to make it easy for folks to add your events to their Microsoft Outlook calendars? A solution is at hand. There's a format called iCalendar that provides for interchange of event information between systems. It's well documented and pretty easy to use. Here's a simple example.

BEGIN:VCALENDAR
PRODID:-//jlion/handcal//NONSGML v1.0//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20080612T140000Z
DTEND:20080612T193000Z
SUMMARY:PM08
ORGANIZER:MAILTO:PAR@par.net
LOCATION:Holiday Inn, Harrisburg/Hershey in Grantville
DESCRIPTION:PM08 Board-General Membership Meeting
UID:1
SEQUENCE: 0
DTSTAMP:20080514T162817Z
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR

To add this as event to a web site, save the information as a file with an "ics" extension and link to it. When the user clicks on the link they will be prompted to add the event to their calendar.

A caveat: The times above (DTSTAMP, DTSTART and DTEND) are in UTC. To reflect local time you will need to adjust these times for your time zone or add additional time zone information (see the msdn article or RFC 2445 for more info).

Lots more information about Microsoft's implementation of iCalendar is available at http://msdn.microsoft.com/en-us/library/bb655909.aspx and there is background on the hows and whys of iCalendar on Wikipedia, here: http://en.wikipedia.org/wiki/ICalendar.

It's easy to see how a specific event would be rendered in iCalendar format. Just create the event in Outlook, open it up then select "Save As" from the file menu and change the "Save as Type" drop-down to "iCalendar Format (*.ics)". The resulting ICS file can be opened up in a text editor for your perusal.

0 Comments:

Post a Comment

<< Home