none
Timezone changes when i update start or end of an appointment RRS feed

  • Question

  • I have an appointment created in the Berlin timezone (utc+1).
    Using EWS (SoapUI) i change the start time of the appointment.
    The new start time is correctly displayed, but the timezone of the appointment is changed to Reykjavik (GMT)

    Here is the relevant part of the request:

    <n2:Updates>
    	<n2:SetItemField>
    		<n2:FieldURI FieldURI="calendar:Start" />
    		<n2:CalendarItem>
    			<n2:Start>2016-04-11T13:30:00.000Z</n2:Start>
    		</n2:CalendarItem>
    	</n2:SetItemField>
    </n2:Updates>
    If i explicitly set the meetingtimezone on the request to "W. Europe Standard Time" it works correctly, but i can do that only for Events from my Default time Zone.

    Monday, April 11, 2016 9:21 AM

Answers

  • >> The timezone property is always set to the Servers local timezone, even if the Event was created in a different timezone.

    EWS is a client API so it would be expected that this is set the clients Timezone, (I know your saying your code is running on server but Exchange can't know this if you put the ServerTime zone at that point all that can happen is that Exchange would assume the user is in that timezone and the appointments will be updated to that timezone). The way to override that behaviour is to set the meetingtimezone (StartTimeZone and EndTimeZone).

    The property you use will vary across different versions of Exchange if people are still on 2007 they should be Migrating in the near future the property you should use depending on version is listed in https://msdn.microsoft.com/en-us/library/office/dn789029(v=exchg.150).aspx

    You should be able to get the TimeZone via one of these properties if not look at the appointment with a MapiEditor like MFCMapi and have a lot at the TimeZone properties that have been set you may need to use Extended property in those cases. The Timezone will be available on the appointment in one of these properties you just need to request it and use it otherwise you going to have that problem.

    One alternative approach I've used when updating a lot of appointment across a number of regionalized mailboxes is discover the TimeZone of the Mailbox and then use that http://gsexdev.blogspot.com.au/2015/11/finding-timezone-being-used-in-mailbox.html

    Cheers
    Glen

    • Marked as answer by Simon Hain Wednesday, April 13, 2016 7:28 AM
    Wednesday, April 13, 2016 2:28 AM

All replies

  • If your going to update the StartTime or Endtime you should include the timezone in the update

    >> it works correctly, but i can do that only for Events from my Default time Zone.

    Why so ? you should be able to retrieve the current timezone from the appointment and include that in the update, the problem is if you don't its going to pull the timezone from the client making the update if everything is in the same timezone its not a problem but once things span timezones including this property is critical.

    Cheers
    Glen

    Tuesday, April 12, 2016 4:53 AM
  • Why so ? you should be able to retrieve the current timezone from the appointment and include that in the update

    Can you tell me how i do that?
    There are two relevant properties, timezone and meetingtimezone.
    The timezone property is always set to the Servers local timezone, even if the Event was created in a different timezone.

    Let's say i create an appointment in Outlook and set the timezone to Athens (UTC+2). The retrieved property is still Berlin:

    <t:TimeZone>(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna</t:TimeZone>
    

    The MeetingTimeZone element seems to be only returned for a RecurringMaster, for a single CalendarItem i do not get it even if i specify it as an additional property.
    There would be the StartTimeZone/EndTimeZone property, but that is not available on 2007_SP1

    I guess we will have to edit the timezone to the local Default on 2007_SP1 and could Support the StartTimeZone/EndTimeZone on later versions.

    Tuesday, April 12, 2016 9:46 AM
  • >> The timezone property is always set to the Servers local timezone, even if the Event was created in a different timezone.

    EWS is a client API so it would be expected that this is set the clients Timezone, (I know your saying your code is running on server but Exchange can't know this if you put the ServerTime zone at that point all that can happen is that Exchange would assume the user is in that timezone and the appointments will be updated to that timezone). The way to override that behaviour is to set the meetingtimezone (StartTimeZone and EndTimeZone).

    The property you use will vary across different versions of Exchange if people are still on 2007 they should be Migrating in the near future the property you should use depending on version is listed in https://msdn.microsoft.com/en-us/library/office/dn789029(v=exchg.150).aspx

    You should be able to get the TimeZone via one of these properties if not look at the appointment with a MapiEditor like MFCMapi and have a lot at the TimeZone properties that have been set you may need to use Extended property in those cases. The Timezone will be available on the appointment in one of these properties you just need to request it and use it otherwise you going to have that problem.

    One alternative approach I've used when updating a lot of appointment across a number of regionalized mailboxes is discover the TimeZone of the Mailbox and then use that http://gsexdev.blogspot.com.au/2015/11/finding-timezone-being-used-in-mailbox.html

    Cheers
    Glen

    • Marked as answer by Simon Hain Wednesday, April 13, 2016 7:28 AM
    Wednesday, April 13, 2016 2:28 AM