[Mono-bugs] [Bug 621366] New: System.DateTime converts NSDate to UTC

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jul 9 20:11:42 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=621366

http://bugzilla.novell.com/show_bug.cgi?id=621366#c0


           Summary: System.DateTime converts NSDate to UTC
    Classification: Mono
           Product: MonoTouch
           Version: SVN
          Platform: Macintosh
        OS/Version: Mac OS X 10.6
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: gnorton at novell.com
        ReportedBy: neal at nc-software.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64;
Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729;
Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E; Creative AutoUpdate
v1.40.01)

Hello,

I reported this in another bug but I can't find it.  The resolution was deemed
by design but I want to reopen the case as iOS 4 has made this issue a bit
worse.

I pointed out that I use MonoTouch.Dialog from Miguel.  In the element for
collecting a date/time input a UIDatePicker is used.  I was having a problem
because somewhere in the code a conversion was occuring from the value
presented in the UIDatePicket to what was stored which ended up being UTC.  I
found out after further investigation that when you set the UIDatePicker.Date
to a System.DateTime variable it gets converted.

The UIDatePicker is designed to present the device's local time to the user. 
In my opinion this value (local) is what needs to be stored and it should not
be getting converted to UTC when you assign the NSDate value to a
System.DateTime variable.

One of my customers is an airline pilot, I created a logbook solution for
pilots ("Logbook Pro").  He begins the flight log entry in a timezone, West
Coast for example, enters a few items, i.e. enters his takeoff time then
suspends the app and also puts his device in airline mode to save battery while
he flies.  He then gets to his destination and resumes the app (iOS 4) and
enters his landing time, he's now on the east coast, 3 hours difference in UTC
offset.  He picks his time presented on screen from the UIDatePicker which is
local.  However, the app converts the date to UTC incorrectly because the app
is still thinking the UTC offset is from the west coast, when the app was
launched.

So the problem could be either the UTC offset is not updating properly when the
app is resumed as the device has changed timezones, or, we need to NOT be
converting what the UIDatePicker is presenting on screen (local) to UTC simply
be setting it to a DateTime variable.

I hope this makes sense.

Thank you.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list