我在网上看到这个问题问了好几次,但找不到答案。
当我使用托管 EWS 2.0 创建约会(会议)时,邀请电子邮件正确显示时间和时区。当我更新会议时,新的邀请电子邮件会显示 UTC 时区的时间。这是 UTC 的正确时间,但应该显示在太平洋。
我在创建服务连接时尝试设置区域,但这使得初始邀请也将时区显示为 UTC,以及任何更新。
我尝试设置 StartTimeZone 和 EndTimeZone 属性,并在绑定约会以进行修改时将这些属性包含在属性集中。
是否有其他属性可以控制 Exchange 在发送邀请时如何格式化时间?这是一些显示我如何执行更新的代码:
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