Thanks Nic - good to know it actually is a TimeZone issue. Being exactly 12 hours off made it look suspicious :)
There must be some other trick, beyond what Mikkel was showing with the * ToLocalTime*() methods to have it convert correctly. Mikkel suggested this: picker.Date = date.ToLocalTime(); date = DateTime.SpecifyKind(picker.Date, DateTimeKind.Local).ToLocalTime(); Were there other time localization calls you were making for TripWallet? On Wed, Jul 11, 2012 at 12:44 AM, Nic Wise <[email protected]> wrote: > The dates that come out of pickers are GMT. You are GMT+12 :) > > (I had the same problem developing TripWallet - I was in NZ then, too) > > On Tue, Jul 10, 2012 at 10:55 AM, Phil Cockfield <[email protected]> > wrote: > > I'm using a UIDatePicker control in a pretty standard way (I think). > That > > is, I'm not setting much configuration at all at initialization: > > > > Control = new UIDatePicker(RectangleF.Empty){ AutoresizingMask = > > UIViewAutoresizing.FlexibleWidth }; > > > > > > The problem is, when I read the selected Date value out of it, the AM/PM > > values are exactly the wrong way around. Eg. 1PM is being returned as > 1AM > > and vice versa. > > > > Here's a GIST of the entire code I've got (for context): > > > > https://gist.github.com/3082372 > > > > > > Is this some kind of time-zone wierdness. I'm in NZ. Doesn't seem like > > it's time-zones though, because it's an exact reversal of the AM/PM > values, > > not a shift in the time. > > > > Thanks! > > -- > > Phil Cockfield > > > > > > _______________________________________________ > > MonoTouch mailing list > > [email protected] > > http://lists.ximian.com/mailman/listinfo/monotouch > > > > > > -- > Nic Wise > t. +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise > b. http://www.fastchicken.co.nz/ > > Earnest: Self-employed? Track your business expenses and income. > http://earnestapp.com > Nearest Bus: find when the next bus is coming to your stop. > http://goo.gl/Vcz1p > mobileAgent (for FreeAgent): get your accounts in your pocket. > http://goo.gl/IuBU > Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa > London Bike App: Find the nearest Boris Bike, and get riding! > http://goo.gl/Icp2 > -- *Phil *Cockfield
_______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
