Fixed TimeZoneInfo.Local on windows xp
authormyrup <github@myl.dk>
Thu, 19 Mar 2015 23:39:19 +0000 (00:39 +0100)
committermyrup <github@myl.dk>
Thu, 19 Mar 2015 23:39:19 +0000 (00:39 +0100)
Fall back to “StandardName” subkey when “TimeZoneKeyName” isn’t present.

mcs/class/corlib/System/TimeZoneInfo.cs

index 5562b8bf49eb39c49cfaaec97c4bcb0664112eea..91edf5d10419a8e05742eb049c1db8a74c3f121c 100644 (file)
@@ -112,6 +112,8 @@ namespace System
 #if !NET_2_1
                        if (IsWindows && LocalZoneKey != null) {
                                string name = (string)LocalZoneKey.GetValue ("TimeZoneKeyName");
+                               if (name == null)
+                                       name = (string)LocalZoneKey.GetValue ("StandardName"); // windows xp
                                name = TrimSpecial (name);
                                if (name != null)
                                        return TimeZoneInfo.FindSystemTimeZoneById (name);