Bug 3983 - MonoTouch.Dialog: DateTimeElement displays wrong date for current locale
Summary: MonoTouch.Dialog: DateTimeElement displays wrong date for current locale
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-03-19 23:14 UTC by John Simons
Modified: 2012-03-27 11:13 UTC (History)
2 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 FIXED

Description John Simons 2012-03-19 23:14:59 UTC
To reproduce this issue, set iPhone simulator settings in General | International to:
Region Format = Australia

Run the MT.D Sample and go to:
Reflection API | Time Samples
As you can see the Alarm text says 6:30P even though in the code we have set it to 7:30AM.
When you click on it the picker initialises the time to 7:30AM.

Also, if you set the birthday to 29 July 1976 the application output displays:
Birthday: 28/07/1976 2:00:00 PM

The reason this occurs is because DateTime in .NET by default the kind is Unspecified but NSDate has to be UTC.

Cross posted here: https://github.com/migueldeicaza/MonoTouch.Dialog/issues/111
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-03-27 11:13:36 UTC
Fixed in master (83403053). This fix will be in the 5.3.3 release.

Note that you can work around this bug by explicitly setting the kind of the date values you put in the DateTimeElement.