Bug 5160 - DateTime.TryParseExact fails when using fractional seconds
Summary: DateTime.TryParseExact fails when using fractional seconds
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-05-18 00:59 UTC by Stuart Carnie
Modified: 2012-05-18 10:18 UTC (History)
2 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 Stuart Carnie 2012-05-18 00:59:34 UTC
The following fails under mono touch.

DateTime.TryParseExact("2012-04-09T07:32:00Z", "yyyy-MM-ddTHH:mm:ss.FFFFFFFK", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out dateTime)

Note, that it does work correctly with desktop edition of mono.

The issue is it does not correctly parse the optional fractional part - specifically the period in the format string fails.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-05-18 07:13:59 UTC
It fails in mono 2.10 and works in mono master/2.11.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2012-05-18 07:52:56 UTC
Fixed, unit test included. The next releases with this fix will be 5.3.4 and 5.2.13.

monotouch master: b2bb6e07f7068d87f2cdcc3e5880dc02107dc136
monotouch 5.2-series: 71b5c670b5dde8105c08e630d61e62f4b157aa05
Comment 3 Stuart Carnie 2012-05-18 10:18:26 UTC
Great work!