【发布时间】:2020-04-06 09:52:02
【问题描述】:
在将 Exchange 日历与 EWS 同步时,我们的客户遇到以下情况:
在 Win 10 客户端计算机上,调用 GetTimeZoneInformation 会返回 TIME_ZONE_ID_DAYLIGHT,即“系统正在 TIME_ZONE_INFORMATION 结构的 DaylightDate 成员所涵盖的范围内运行。”
标准名称为:西欧标准时间
DaylightName 是:W. Europe Daylight Time
IIRC 正确,我现在需要搜索 HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\ 的 Dlt 条目以确定时区的根键名称。
但是'W.欧洲夏令时”不存在:有 139 个条目,但没有一个有名为“W.欧洲夏令时'
所以我的代码无法转换为正确的根键名称并输入 'W. EWS SOAP 调用中的“欧洲夏令时”如下:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages">
<soapenv:Header>
<typ:RequestServerVersion Version="Exchange2013"/>
<typ:MailboxCulture>en-US</typ:MailboxCulture>
<typ:TimeZoneContext>
<typ:TimeZoneDefinition Id="W. Europe Daylight Time"/>
</typ:TimeZoneContext>
</soapenv:Header>
<soapenv:Body>
<mes:ResolveNames ReturnFullContactData="1" SearchScope="ActiveDirectory">
<mes:UnresolvedEntry>someone@somewhere.com</mes:UnresolvedEntry>
</mes:ResolveNames>
</soapenv:Body>
</soapenv:Envelope>
...这些失败并出现以下错误:
GetCalendarFolder (calendar): FaultInBody: A time zone with the specified ID could not be found.
Details: ErrorTimeZone Id: W. Europe Daylight Time
在客户端计算机上,在注册表中搜索 'W. Europe',我发现 一个 条目说:
RootKeyName: W. Europe Standard Time
DisplayName: (UTC+01:00) Amsterdam, Berlijn, Bern, Rome, Stockholm, Wenen
StandardName: West-Europa (standaardtijd)
DaylightName: West-Europa (zomertijd)
这台机器有以下语言设置:
Default system UI language : en-US
System locale : nl-NL
Default time zone : W. Europe Standard Time
Installed language(s): en-US
Type : Fully localized language.
Installed language(s): nl-NL
Type : Partially localized language, MUI type.
Fallback Languages en-US
我怀疑这些“本地化”(?) StandardName/DaylightName 注册表值使我无法正确查找“W.欧洲标准时间的时区 ID。
FWIW,Exchange 服务器有:
TIME_ZONE_ID_DAYLIGHT
StandardName: W. Europe Standard Time
DaylightName: W. Europe Daylight Time
并且确实有一个注册表项
RootKeyName: W. Europe Standard Time
DisplayName: (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
StandardName: W. Europe Standard Time
DaylightName: W. Europe Daylight Time
我该如何解决这个问题?
【问题讨论】:
标签: localization timezone exchangewebservices