【发布时间】:2011-12-17 07:32:33
【问题描述】:
交换和时区将是我的死亡。
我的 Exchange Server 位于美国东部标准时间 (UTC -5)。 Exchange 的版本是 2007 SP1。用户位于法国巴黎 (UTC +2)。如果我尝试将约会创建为全天活动,它将始终跨越 2 天。这是请求:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ns2:MailboxCulture xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
>en-US</ns2:MailboxCulture>
<ns2:RequestServerVersion
xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
Version="Exchange2007_SP1"/>
<ns2:TimeZoneContext xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ns2:TimeZoneDefinition Id="Romance Standard Time"/>
</ns2:TimeZoneContext>
</soap:Header>
<soap:Body>
<CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types"
SendMeetingInvitations="SendToAllAndSaveCopy">
<SavedItemFolderId>
<ns2:DistinguishedFolderId Id="calendar"/>
</SavedItemFolderId>
<Items>
<ns2:CalendarItem>
<ns2:Subject>Test TZ</ns2:Subject>
<ns2:Body BodyType="Text"/>
<ns2:Start>2011-10-28T09:00:00Z</ns2:Start>
<ns2:End>2011-10-28T17:00:00Z</ns2:End>
<ns2:IsAllDayEvent>true</ns2:IsAllDayEvent>
<ns2:Location>Somewhere</ns2:Location>
</ns2:CalendarItem>
</Items>
</CreateItem>
</soap:Body>
</soap:Envelope>
注意:我将计算机上的时区设置为“(UTC+01:00) 布鲁塞尔、哥本哈根、马德里、巴黎”,尽管计算机实际位于美国东部标准时间。
这是 Outlook 显示的内容,跨越 2 天。
如果我从 Exchange 检索新创建的日历项目,它会显示以下开始和结束日期/时间:
<t:Start>2011-10-28T00:00:00Z</t:Start>
<t:End>2011-10-29T00:00:00Z</t:End>
<t:IsAllDayEvent>true</t:IsAllDayEvent>
(Entire response can be found here)
我尝试了开始日期和结束日期的各种组合,但无论我做什么,我总是能得到 2 天的时间。如果我在 EST 中运行相同的东西(没有 tz 上下文标头),它只会跨越一天。
【问题讨论】:
标签: web-services soap exchange-server exchangewebservices