diff --git a/Parse/Internal/PlatformHooks/Phone/PlatformHooks.Phone.cs b/Parse/Internal/PlatformHooks/Phone/PlatformHooks.Phone.cs index 033605c0..44b56fd3 100644 --- a/Parse/Internal/PlatformHooks/Phone/PlatformHooks.Phone.cs +++ b/Parse/Internal/PlatformHooks/Phone/PlatformHooks.Phone.cs @@ -150,17 +150,12 @@ public string DeviceType { public string DeviceTimeZone { get { - // We need the system string to be in english so we'll have the proper key in our lookup table. - var culture = Thread.CurrentThread.CurrentCulture; - Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; - string windowsName = TimeZoneInfo.Local.StandardName; - Thread.CurrentThread.CurrentCulture = culture; - - if (ParseInstallation.TimeZoneNameMap.ContainsKey(windowsName)) { - return ParseInstallation.TimeZoneNameMap[windowsName]; - } else { - return null; - } + TimeSpan utcOffset = TimeZoneInfo.Local.BaseUtcOffset; + return String.Format("GMT{0}{1}:{2:d2}", + offset.TotalSeconds < 0 ? "-" : "+", + Math.Abs(offset.Hours), + Math.Abs(offset.Minutes) + ); } } diff --git a/Parse/Internal/PlatformHooks/Unity/PlatformHooks.Unity.cs b/Parse/Internal/PlatformHooks/Unity/PlatformHooks.Unity.cs index 1bcb8885..cffca375 100644 --- a/Parse/Internal/PlatformHooks/Unity/PlatformHooks.Unity.cs +++ b/Parse/Internal/PlatformHooks/Unity/PlatformHooks.Unity.cs @@ -87,16 +87,12 @@ public string DeviceType { public string DeviceTimeZone { get { - try { - string windowsName = TimeZoneInfo.Local.StandardName; - if (ParseInstallation.TimeZoneNameMap.ContainsKey(windowsName)) { - return ParseInstallation.TimeZoneNameMap[windowsName]; - } else { - return null; - } - } catch (TimeZoneNotFoundException) { - return null; - } + TimeSpan utcOffset = TimeZoneInfo.Local.BaseUtcOffset; + return String.Format("GMT{0}{1}:{2:d2}", + offset.TotalSeconds < 0 ? "-" : "+", + Math.Abs(offset.Hours), + Math.Abs(offset.Minutes) + ); } }