【问题标题】:EWS update changes time zone to UTCEWS 更新将时区更改为 UTC
【发布时间】:2013-01-18 18:31:32
【问题描述】:

我在网上看到这个问题问了好几次,但找不到答案。

当我使用托管 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

【问题讨论】:

    标签: exchangewebservices exchange-server-2010


    【解决方案1】:

    我意识到这是一个令人沮丧的答案,但我相信这是一个 Exchange 错误。无论您如何调整 API 公开的各种时区属性,这种行为仍然会发生。据我所知,也没有任何服务器级设置会影响这一点,尽管我承认我还没有仔细研究过所有这些设置。

    在我的情况下,附加的 UTC 时间似乎伴随着消息在更新时从其原始 HTML 更改为纯文本版本。该错误 (http://support.microsoft.com/kb/2689810) 已修复,但我的组织尚未应用该补丁。我想,当另一个错误被修复时,这个错误可能已经过时了。如果在您的 Exchange 服务器上安装更新是一种选择,那么这可能值得一试。

    【讨论】:

      猜你喜欢
      • 2020-08-31
      • 1970-01-01
      • 1970-01-01
      • 2016-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-18
      • 1970-01-01
      相关资源
      最近更新 更多