Bug 52500 - TimeZoneNotFoundException on DateTime.Today
Summary: TimeZoneNotFoundException on DateTime.Today
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 7.1 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2017-02-14 14:03 UTC by Saryu Wahi
Modified: 2017-06-14 19:56 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Saryu Wahi 2017-02-14 14:03:35 UTC
Getting a TimeZoneNotFound Exception for our users while the app is attempting to fetch DateTime.Today 

Please check below stacktrace (from HockeyApp)

Xamarin caused by: android.runtime.JavaProxyThrowable: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TimeZoneNotFoundException: Exception of type 'System.TimeZoneNotFoundException' was thrown.
System.TimeZoneInfo.get_Local()<a67c5439364a4a4992cd952d9010b635>:0
System.TimeZoneInfo.GetDateTimeNowUtcOffsetFromUtc(DateTime time, ref bool isAmbiguousLocalDst)<a67c5439364a4a4992cd952d9010b635>:0
System.DateTime.get_Now()<a67c5439364a4a4992cd952d9010b635>:0
System.DateTime.get_Today()<a67c5439364a4a4992cd952d9010b635>:0
Comment 1 Daniel Vaughan 2017-04-13 12:02:03 UTC
I'm experiencing this too. I tried replacing all calls to DateTime.Now with DateTime.UtcNow but framework classes are raising an exception:

Xamarin.Android 7.2


04-13 13:50:34.624: E/mono(8381): System.TimeZoneNotFoundException: Exception of type 'System.TimeZoneNotFoundException' was thrown.
04-13 13:50:34.624: E/mono(8381):   at System.TimeZoneInfo.get_Local () [0x00018] in <e59c60a6d5354f38b7729c0021293fac>:0 
04-13 13:50:34.624: E/mono(8381):   at System.TimeZoneInfo.GetDateTimeNowUtcOffsetFromUtc (System.DateTime time, System.Boolean& isAmbiguousLocalDst) <0xce28df88 + 0x00023> in <e59c60a6d5354f38b7729c0021293fac>:0 
04-13 13:50:34.624: E/mono(8381):   at System.DateTime.get_Now () <0xce2df180 + 0x00093> in <e59c60a6d5354f38b7729c0021293fac>:0 
04-13 13:50:34.624: E/mono(8381):   at System.Timers.Timer.MyTimerCallback (System.Object state) [0x0001f] in <6d6e6da19507440ea5ac07a9d1d9b01a>:0 
04-13 13:50:34.624: E/mono(8381):   at System.Threading.Timer+Scheduler.TimerCB (System.Object o) [0x00007] in <e59c60a6d5354f38b7729c0021293fac>:0 
04-13 13:50:34.624: E/mono(8381):   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0xce3492dc + 0x00057> in <e59c60a6d5354f38b7729c0021293fac>:0 
04-13 13:50:34.624: E/mono(8381):   at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in <e59c60a6d5354f38b7729c0021293fac>:0 
04-13 13:50:34.624: E/mono(8381):   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0xce3491bc + 0x00007> in <e59c60a6d5354f38b7729c0021293fac>:0
Comment 2 Cody Beyer (MSFT) 2017-06-14 19:56:22 UTC
I am unable to reproduce this in the latest version of Xamarin Android. If you are still experiencing this issue, please provide a test case, as well as steps to reproduce.

Thanks!