EWS更新将时区更改为UTC [英] EWS update changes time zone to UTC
问题描述
我已经在网上多次问过这个问题,但是找不到答案.
I've seen this question asked several times on the web, but cannot find an answer.
当我使用托管的EWS 2.0创建约会(会议)时,邀请电子邮件会正确显示时间和时区.当我更新会议时,新的邀请电子邮件会显示UTC时区中的时间.现在是UTC的正确时间,但应显示在太平洋时间.
When I create an appointment (meeting) using managed EWS 2.0, the invitation email correctly shows the time and time zone. When I update the meeting, the new invitation emails show the time in the UTC time zone. It is the correct time for UTC, but should display in Pacific.
我已经在创建服务连接时尝试设置时区,但这使初始邀请也将时区显示为UTC以及任何更新.
I have tried setting the zone when creating the service connection, but this makes the initial invitation also show the time zone as UTC, as well as any updates.
我尝试设置StartTimeZone和EndTimeZone属性,并在绑定修改约会时将这些属性包括在属性集中.
I've tried setting the StartTimeZone and EndTimeZone properties, and have included those properties in the property set when binding the appointment for modification.
在某处是否有另一个属性可以控制Exchange发送邀请时格式化时间的方式?这是一些代码,显示我如何执行更新:
Is there another property somewhere that controls how Exchange formats the time when sending out the invitations? Here is some code showing how I am performing the updates:
Dim EWS As ExchangeService = GetEWSConnection(UserEmailAddress)
Dim meeting As Appointment = Appointment.Bind(EWS, New ItemId(CalendarEvent.ItemKey), New PropertySet(BasePropertySet.IdOnly, AppointmentSchema.Start, AppointmentSchema.End, AppointmentSchema.ReminderDueBy, AppointmentSchema.StartTimeZone, AppointmentSchema.EndTimeZone, AppointmentSchema.TimeZone, AppointmentSchema.Subject, AppointmentSchema.Location, AppointmentSchema.Body))
Dim timeZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(LocalTimeZoneID)
With meeting
.Subject = CalendarEvent.Subject
.Location = CalendarEvent.Location
.Body = CalendarEvent.Body
.Start = CalendarEvent.StartTime
.End = CalendarEvent.EndTime
.StartTimeZone = timeZone
.EndTimeZone = timeZone
' snip (removed attendee add/remove)
.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToChangedAndSaveCopy)
End With
推荐答案
我意识到这是一个令人沮丧的答案,但是我认为这是一个Exchange错误.无论您如何调整API公开的各种时区属性,此行为仍然会发生.据我所知,虽然我承认并没有梳理所有这些设置,但也没有任何服务器级别的设置会影响此设置.
I realize that this is a frustrating answer, but I believe this to be an Exchange bug. No matter how you adjust the various time zone properties exposed by the API, this behavior still occurs. As far as I can tell, there aren't any server-level settings that would affect this either, although I admittedly haven't combed through all of them.
就我而言,与附加的UTC时间一起出现的是,消息在更新后从其原始HTML更改为纯文本版本.该错误( http://support.microsoft.com/kb/2689810 )已修复,但是我的组织尚未应用此补丁.我想,当另一个bug修复后,该bug可能过时了.如果可以选择在Exchange服务器上安装更新,那么可能值得尝试.
In my case, what seems to go along with the appended UTC time is that the message is changed from its original HTML to a plain text version upon update. That bug (http://support.microsoft.com/kb/2689810) has been fixed, but my organization hasn't applied the patch yet. It's possible, I suppose, that this bug was rendered obsolete when the other was fixed. If installing an update on your Exchange server is an option, then that might be worth a shot.
这篇关于EWS更新将时区更改为UTC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!