1.6 All Day Events and Time Zones

GroupWise all day events can cause problems if applications need to apply the sender's time zone to the start and end dates.


An application displays an all day event on the wrong day.


GroupWise clients set the startDate and endDate to midnight of the user's time zone. As the item is saved to the user's database, all times are converted to UTC. This causes problems in determining the actual date of the all day event because the date and time on the event shifts. The shift depends the time zone of the GroupWise clients.

As an example, suppose a GroupWise client sends an all day event on 9/26/2012 with a time zone of Mountain Daylight Time. The output for this all day event is as follows:

<item type="Appointment">
<subject>All Day Event</subject>
<name>Mountain Daylight Time</name>
<dayOfWeek occurrence="First">Sunday</dayOfWeek>
<name>Mountain Standard Time</name>
<dayOfWeek occurrence="Last">Sunday</dayOfWeek>

In the output above, the startDate has a value of <startDate>2012-09-26T06:00:00Z</startDate>. The time is 6:00 a.m. because GroupWise saves the time in UTC. UTC is 6 hours ahead of MDT in our example.

In order to determine the real date of the all day event, you need to change the startDate and endDate to midnight by using a time zone to represent the sender’s time zone. An application adds the sender’s time zone offset to the startDate and endDate values.

Using the example above, this appears as follows:

<startDate>2012-09-26T06:00:00Z</startDate> + <offset>-21600</offset> = <startDate>2012-09-26T00:00:00Z</startDate>

The adjusted startDate is midnight. The endDate needs the same adjustment.

AllDayEvents returns a startDate, startDay, endDate, and endDay. The startDate and endDate have times associated with the dates, as follows:


StartDay and endDay do not have time associated with the dates:


Use the elements that don't return a time. If an all day event does not interact with other GroupWise or third-party clients, the startDay and endDay elements can be used. Otherwise, you need to use the adjusted startDate and endDate elements.