azure - Recurring appointment created in EWS in timezone UTC is shifting 1 hour after daylight saving time changes -
I have a recurring appointment which I created with Exchange Web Services EWS 2.0 in C # which is connected to Office 365 Exchange it happens. Appointments for summer time are displayed correctly on my Outlook agenda but after October 26 (during winter) the appointment was transferred with an hour (before).
Obviously this is something with daylight saving time, but I can not understand how it works. I would say that the appointment should be set in the scheduled time and UTC by Outlook to display at its correct timezone (UTC + 1 Amsterdam) and DST. But it fails on DST.
As you can see in Co, the relevant part of the code that I use to make the appointment:
Create the service:
Exchange service _Service = New ExchangeService ExchangeVersion.Exchange2013_SP1, TimeZoneInfo.Utc); Set the timezone:
appointment Starttime = time zone info.utc; Appointment Endimjon = timezoneinfo UTSC; But still the appointment is shifted on Daylight Savings Changes.
How can I make recurring appointments with EWS that display correctly in the whole year's Outlook?
Edit: Thank you for solving this, Venkat-Ayyadewar-MSFT and Pjennery.
In fact, the time difference between West Europe and UTC is 2 hours in summer, and only one in winter time, if you set your appointment in UTC, then starttime in UTC is always a That's it. But when W-Europe has a 2-hour apprenticeship in summers and only one hour in winter, the appointment turns to time for W-Europe TZ for one hour.
Solution: Determine the time at which TZ should be started, and for your appointment, determine the time zone that is time to recover from your service or the database that is not in the time zone, So you need to convert it to the time zone of appointment.
Here is a code sample that reads in UTC from a SQL database and convert them to Amsterdam time. Accounting for Daylight Savings Time should meet your requirements using TimeZoneInfo.ConvertTimeFromUtc () ie.
Exchange service service = new exchange service (ExchangeWersian.exchange2013_sp1, timezoneinfo.utc); // Create recurring calendar items Placement appointment = New placement (service); Appointment Subject = "some topics"; Date Time Start = New Date Time (2014, 10, 14, 16, 0, 0); Appointment Start = time zonefox ConvertTimeFruitUUTC (Start, TimezoneInfoFindsistTimeJobBIID ("W Europe Standard Time")); Appointment Starttime = time zoneoinfo FindSistimeJobBIID ("W Europe Standard Time"); Date Time End = New Date Time (2014, 10, 14, 17, 0, 0); Appointment End = timezone information ConvertTimeFruitUUTC (End, TimezoneInfoFindsistTimeJobBIID ("W Europe Standard Time")); Appointment Endimjon = time zoneoinfo FindSistimeJobBIID ("W Europe Standard Time"); Appointment Location = "some place"; Dayoff the Vacc [] Day = New Daydream [] (TheWeek.S Saturday of the Day); Appointment Recurrence = new recurrence Weekly (appointment start date, 1, day); Appointment Recommendation Start date = appointment Start.date; Appointment Revision. Number off offline = 20; // Save Appointment Appointments. Save (SendInvitationsMode.SendToNone); Hopefully works for you Also look for the time zone definitions used by the EWS managed API.
Let me know if you have any questions or need more information.
Thanks,
Venkata
Comments
Post a Comment