Iphone UIDatePicker shows wrong date in Central time zone

I'm at a loss. I have an NSDate that is passed by a UIDatePicker. When I'm set to the eastern time zone, everything is fine.

When I am set to Central, the date selection shows that the time is off for 1 hour.

So, if I turn on my NSLogs, this is what I will show:

2010-08-25 18:15:19.317[59299:207] ---- into the picker --->2010-08-25 17:37:51 -0500
2010-08-25 18:15:19.318[59299:207] Local Time Zone America/Chicago
2010-08-25 18:15:19.318[59299:207] 2010-08-25 17:37:51 -0500
2010-08-25 18:15:19.319[59299:207] current locale: en_US

But UIDatePicker displays "Today is 6:37 pm."

If I reset my timezone to east, I get the following:

2010-08-25 19:26:11.551[59521:207] ---- into the picker --->2010-08-25 18:37:51 -0400
2010-08-25 19:26:11.552[59521:207] Local Time Zone America/New_York
2010-08-25 19:26:11.552[59521:207] 2010-08-25 18:37:51 -0400
2010-08-25 19:26:11.553[59521:207] current locale: en_US

And the UIDatePicker displays "Today is 6:37 pm."

It's just interesting if anyone has seen this before. This seems like a time zone or daylight saving problem, but I can't track it.

Any help would be appreciated.

edit: , , . , UIDatePicker . , -, .

+5
1

. , .

, iPhoneDevSDK - http://www.iphonedevsdk.com/forum/iphone-sdk-development/52533-uidatepicker-bug-ios-4-a.html - UIDatePicker.

, UIDatePicker.

, , .

datePicker.timeZone = [NSTimeZone localTimeZone];

().

+6

All Articles