如何将时区设置为frecnh zone + windows ce

时间:2015-10-21 14:06:33

标签: compact-framework windows-ce windows-embedded-compact compact-framework2.0

我需要在移动设备中将时区设置为c#(windows embedded ce)中的法语区

我该怎么办呢?

2 个答案:

答案 0 :(得分:1)

您可以使用此库来简化您的开发:https://opennetcf.codeplex.com/

我正在使用它并通过以下对象设置时区:TimeZoneCollection,TimeZoneInformation,DateTimeHelper。

答案 1 :(得分:0)

您无法将TimeZone设置为城市/位置,您只能设置DST数据。

在此处查看我的帖子:http://community.intermec.com/t5/Device-Management/change-Time-Zone-with-xml/m-p/17007/highlight/true#M1023

=============================================== ============= 您无法使用注册表设置TimeZone的名称!

您只能设置偏移和DST值。然后,时钟面板使用匹配的条目。

在注册表中,“GMT-7(Mountain US)”和“GMT-7(Arizona)”的值几乎相同

[HKEY_LOCAL_MACHINE \ SOFTWARE \微软\时钟] “了AppInfo”=十六进制(3):01,00,00,00,80,01,00,00,0f,00,00,00,00,00,00,00,00,00,00,00,3a ,01,00,00,69,00,00,00,00,00,00,00,01,00,00,00 “届时AppState”=十六进制(3):11 “AutoDST”= DWORD:00000000 “GMT_OFFSET”= DWORD:000001A4 “HomeDST”= DWORD:00000000 “NetworkTimeNotifyUser”= DWORD:00000001 “NetworkTimeSync”= DWORD:00000001 “TZIndex”= DWORD:00000004

(另见http://peterfoot.net/HomeAndVisitingClocksInProfessionalEdition.aspx

[HKEY_LOCAL_MACHINE \ SOFTWARE \微软\时钟] “了AppInfo”=十六进制(3):01,00,00,00,80,01,00,00,0a,00,00,00,00,00,00,00,01,00,00,00,3a ,01,00,00,69,00,00,00,00,00,00,00,01,00,00,00 “届时AppState”=十六进制(3):11 “AutoDST”= DWORD:00000000 “GMT_OFFSET”= DWORD:000001A4 “HomeDST”= DWORD:00000001 “NetworkTimeNotifyUser”= DWORD:00000001 “NetworkTimeSync”= DWORD:00000001 “TZIndex”= DWORD:00000004

但是,正如您所看到的,时区没有名称字符串。

[HKEY_LOCAL_MACHINE \时间] “TimeZoneInformation”=十六进制(3):a4,01,00,00,55,00,53,00,20,00,4d,00,6f,00,75,00,6e,00,74,00,61 ,00,69,00,6e,00,20,00,53,00,74,00,61,00,6e,00,64,00,61,00,72,00,64,00,20,00 ,54,00,69,00,6d,00,65,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 ,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,55,00,53,00,20,00,4d,00 ,1207米,00,75,00,6e,00,74,00,61,00,69,00,6e,00,20,00,44,00,61,00,79,00,6c,00,69 ,00,67,00,68,00,74,00,20,00,54,00,69,00,6d,00,65,00,00,00,00,00,00,00,00,00 ,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,C4,FF,FF ,FF

[HKEY_LOCAL_MACHINE \时间] “TimeZoneInformation”=十六进制(3):a4,01,00,00,4d,00,6f,00,75,00,6e,00,74,00,61,00,69,00,6e,00,20 ,00,53,00,74,00,61,00,6e,00,64,00,61,00,72,00,64,00,20,00,54,00,69,00,6d,00 ,65,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,0b ,00,00,00,01,00,02,00,00,00,00,00,00,00,00,00,00,00,4d,00,6f,00,75,00,6e,00 ,74,00,61,00,69,00,6e,00,20,00,44,00,61,00,79,00,6c,00,69,00,67,00,68,00,74 ,00,20,00,54,00,69,00,6d,00,65,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 ,00,00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00,C4,FF,FF ,FF

这些是TimeZoneInformations(TIME_ZONE_INFORMATION结构)。

Clipboard02.gif

您可以在附件(TZ-cities.txt)中查询时区城市数据库。

附加工具(timezoneset.exe)可用于更改当前活动时区的偏移量。

布拉格和柏林的时区信息是相同的:

指数:95     简称:GMT + 1布达佩斯,布达佩斯     名称:中欧标准时间     GMT抵消:-60     dst名称:中欧夏令时     DST偏移:0 ...

指数:110     简称:GMT + 1柏林,罗马     名称:W。欧洲标准时间     GMT抵消:-60     dst名称:W。欧洲日光时间     DST偏移:0

除了dst名称。

使用注册表设置时区信息不是一个好主意。