iphone UIDatePicker showing wrong date in Central Timezone

前端 未结 1 1678
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-13 06:34

I am at a loss. I have an NSDate that gets passed to a UIDatePicker. When I am set to the Eastern time zone, all is fine.

When I am set to Central, the date picker s

相关标签:
1条回答
  • 2021-01-13 07:39

    I did some more searching. It sure helps if you use the correct search terms.

    Anyhow, I found the answer on the iPhoneDevSDK - http://www.iphonedevsdk.com/forum/iphone-sdk-development/52533-uidatepicker-bug-ios-4-a.html - UIDatePicker bug.

    It looks like there might be a UIDatePicker bug.

    I added this to my code before I set the picker and it fixed the problem.

    datePicker.timeZone = [NSTimeZone localTimeZone];
    

    No more problem (for now).

    0 讨论(0)
提交回复
热议问题