Here's a summary I wrote:
Moodle iCalendar export summary
There are many cases where it would be useful for a user to be able to export events from their calendar in Moodle into a separate calendar program such as Evolution or Kontact. Many such programs also support subscribing to a remote calendar feed, in which case the program automatically downloads the latest version of the calendar at regular intervals.
The standard format for calender information is iCalendar, as defined by RFC 2445 (http://www.faqs.org/rfcs/rfc2445.html). This format is supported in varying degrees by Korganiser/Kontact, Evolution, Mozilla Calendar, Apple iCal, Google Calendar and Microsoft Outlook.
I have implemented support for Moodle to export calendars to iCalendar format, in such a way that subscription is possible as well as download. This support is based on a partial implementation by Jon Papaioannou, using his Bennu (http://bennu.sourceforge.net/) library.
This can be accessed by two links at the bottom of the calendar page (calendar/view.php). 'Quick download / subscribe to calendar' links straight to download all events (global events, user events for the logged-in user and course events for relevant courses) from the last 5 or next 60 days. The URL includes the username and does not require logging in in the usual manner, so that it can be subscribed to with calendar applications, which are of course unable to handle the usual login process. Instead, a reasonable measure of security is provided by the 'authtoken' parameter in the URL, which is a SHA-1 hash of the username concatenated with the password hash. The use of a hash means that should someone else get hold of the URL they cannot discover the user's password. The use of both username and password in generating the hash avoids the problem of discovering users with the same password. This basic approach was suggested by Martin Dougiamas in the forum thread at http://moodle.org/mod/forum/discuss.php?d=37393.
This form is handled by calendar/export.php and calendar/export_basic.php. The actual export process is handled by calendar/export_execute.php, with the help of Bennu.
I have tested the exported file in Korganiser/Kontact, Evolution, Outlook, Google Calendar and Mozilla Calendar and it seems to work in all 5, though Mozilla Calendar doesn't handle the timezone quite right.