When cross compiling with gcc, LIBC is defined and
thus never checks the registry for the timezone information.
This change is released under the MIT license.
using (Stream stream = GetMonoTouchData (null)) {
return BuildFromStream ("Local", stream);
}
-#elif LIBC
+#else
+ if (IsWindows && LocalZoneKey != null) {
+ string name = (string)LocalZoneKey.GetValue ("TimeZoneKeyName");
+ name = TrimSpecial (name);
+ if (name != null)
+ return TimeZoneInfo.FindSystemTimeZoneById (name);
+ }
+
var tz = Environment.GetEnvironmentVariable ("TZ");
if (tz != null) {
if (tz == String.Empty)
return null;
}
}
-#else
- if (IsWindows && LocalZoneKey != null) {
- string name = (string)LocalZoneKey.GetValue ("TimeZoneKeyName");
- name = TrimSpecial (name);
- if (name != null)
- return TimeZoneInfo.FindSystemTimeZoneById (name);
- }
-
- return null;
#endif
}