NSDateFormatter issue with date format in iOS 8

喜夏-厌秋 提交于 2019-12-01 07:55:42

iOS8 have serious problem with time format imo. I've just resolved a bug on my application (that i've never had with iOS7) going to settings -> general -> date time -> time format, switching it from 24 to 12 and then back to 24 and all started working again.

Try to make my same procedure, maybe it work also for you!

I got problems with NSDateFormatter in iOS 8 too, and had to build a fix version for an app. You could read this. It basically takes to overwrite the default locale:

formatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];

But it's best not to use it for formats you want to show to the user. Hope it helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!