About Rebasing Calendars Programmatically for Daylight Saving Time

About Rebasing Calendars Programmatically for Daylight Saving Time

Many countries observe daylight saving time (DST) by advancing clocks so that evenings have longer daylight. This is typically done by setting the clock an hour ahead in the spring, and setting the clock an hour back in the fall. In this topic, this period between the spring and fall is referred to as the DST period. Most countries have their own regulations for when DST starts and ends. The dates of the DST period can change from year to year, and users must update their Microsoft Office Outlook calendar every time that the DST regulations change.

If you use the Windows Vista operating system or have Windows automatic updating turned on, you may not be affected by the change in DST. Otherwise, you should install DST updates for Windows. Regardless of whether the updates are installed automatically, on your behalf by an IT department, or by yourself as a home user, some existing appointments that occur during the DST period might display incorrect times after the DST updates for Windows are installed. This is true for both recurring and single-instance appointments. You must update these appointments to display them correctly in Outlook, in Microsoft Office Outlook Web Access, and in applications that are based on Collaboration Data Objects (CDO). Updating incorrectly displayed appointments on calendars because of DST is known as rebasing calendars.

Outlook provides tools for users and Microsoft Exchange Server provides tools for administrators to rebase calendars. Outlook provides the Time Zone Data Update Tool for Microsoft Office Outlook. With this tool, users can update their own calendars. Exchange Server provides the Exchange Calendar Update Tool that helps administrators to avoid difficulties that result from deploying the Outlook tool widely to all users and to make sure that each user runs the Outlook tool correctly.

In addition to relying on users to run the Time Zone Data Update Tool or administrators to run the Exchange Calendar Update Tool, third-party MAPI client software developers can download an assembly, Tzmovelib.dll. By using this assembly, developers can use the same APIs that Outlook and Exchange Server use in their calendar rebasing tools. The following list shows the calendar rebasing APIs:

To write an appointment rebasing tool by using the calendar rebasing APIs, you can use the following procedure:

  1. Use IOlkApptRebaser::BeginEnumerateAppointments and IOlkApptRebaser::EndEnumerateAppointments to find appointments that are candidates for rebasing. If necessary, present information to enable the user to decide which appointments to rebase. Alternatively, use MAPI or the Outlook Object Model to examine the time and recurrence information for an appointment by parsing dispidApptTZDefStartDisplay, dispidApptTZDefEndDisplay, and dispidApptTZDefRecur.
  2. Use HrCreateApptRebaser, IOlkApptRebaser::BeginRebaseAppointments, and IOlkApptRebaser::EndRebaseAppointments to rebase the appointment.

To obtain the Tzmovelib.dll assembly, download the OutlookTimeZoneMoveLibRedist.exe redistributable installer and the Tzmovelib.h header file at Outlook 2007 Auxiliary Reference Code Samples and Redistributable Installer. OutlookTimeZoneMoveLibRedist.exe installs the Tzmovelib.dll assembly file in C:\Program Files\MsExTmz. Note that third-party calendar rebasing applications can redistribute only the installer, OutlookTimeZoneMoveLibRedist.exe, and must not redistribute the assembly, Tzmovelib.dll, or any other extracted components separately from the installer.

See Also

Daylight Saving Time Help and Support Center

KB 941018: How to address daylight saving time by using the Exchange Calendar Update Tool

KB 931667: How to address the daylight saving time changes in 2007 by using the Time Zone Data Update Tool for Microsoft Office Outlook

About Persisting TZDEFINITION to a Stream to Commit to a Binary Property

How to: Parse a Stream from a Binary Property to Read the TZDEFINITION Structure

How to: Parse a Stream from a Binary Property to Read the TZREG Structure

How to: Read Time Zone Properties from an Appointment