Bug 33729 - TimeZoneNotFoundException on DateTime.Now
Summary: TimeZoneNotFoundException on DateTime.Now
Status: RESOLVED DUPLICATE of bug 28300
Alias: None
Product: iOS
Classification: Xamarin
Component: BCL Class Libraries ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: marcos.henrich
Depends on:
Reported: 2015-09-06 23:00 UTC by Dillon Buchananq
Modified: 2015-09-10 22:23 UTC (History)
5 users (show)

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:

Description Dillon Buchananq 2015-09-06 23:00:12 UTC
I have 62 instances in my error tracker for my application that Xamarin.iOS is loosing it's shit when calling DateTime.Now.ToString() on some devices. The following is the stack trace from my application.

Stacktrace (most recent call first):

  Module "CodeHub.iOS.AppDelegate", line 0, in Main
    Void Main(System.String[])
  Module "MonoTouch.UIKit.UIApplication", line 0, in Main
    Void Main(System.String[], System.String, System.String)
  Module "MonoTouch.UIKit.UIApplication", line 0, in Main
    Void Main(System.String[], IntPtr, IntPtr)
  Module "CodeHub.iOS.AppDelegate", line 0, in FinishedLaunching
    Boolean FinishedLaunching(MonoTouch.UIKit.UIApplication, MonoTouch.Foundation.NSDictionary)
  Module "System.DateTime", line 0, in get_Now
    System.DateTime get_Now()
  Module "System.TimeZone", line 0, in GetLocalTimeDiff
    System.TimeSpan GetLocalTimeDiff(System.DateTime)
  Module "System.CurrentSystemTimeZone", line 0, in GetUtcOffset
    System.TimeSpan GetUtcOffset(System.DateTime)
  Module "System.TimeZoneInfo", line 0, in get_Local
    System.TimeZoneInfo get_Local()
  Module "System.TimeZoneInfo", line 0, in CreateLocal
    System.TimeZoneInfo CreateLocal()
  Module "System.TimeZoneInfo", line 0, in GetMonoTouchData
    System.IO.Stream GetMonoTouchData(System.String, Boolean)

This is the code in question:

        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
            var startup = Mvx.Resolve<IMvxAppStart>();


			this.StampInstallDate("CodeHub", DateTime.Now.ToString()); // <-----

            InAppPurchases.Instance.PurchaseError += HandlePurchaseError;
            InAppPurchases.Instance.PurchaseSuccess += HandlePurchaseSuccess;

The running version was not compiled with the latest verison of Xamarin.iOS but a previous one (can't recall the version). The running iOS verisons are all latest (8.3-8.4).
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-09-07 04:59:25 UTC
Do you know where these users are or which locale they're using?
Comment 2 Sebastien Pouliot 2015-09-10 22:23:39 UTC
Already reported in #28300

*** This bug has been marked as a duplicate of bug 28300 ***