开发者

NSDateFormatter is showing wrong date format (nachm. instead of PM) in the simulator

开发者 https://www.devze.com 2023-01-16 04:37 出处:网络
Why does the simulator is showing me 10:30 nachm. instead of 10:30 PM? I use the following code: NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];

Why does the simulator is showing me 10:30 nachm. instead of 10:30 PM? I use the following code:

NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat: @"h:mm a"];
NSLog(@"%@",[dateformat stringFromDate: myDate]);

OK I think I have to 开发者_开发技巧set a Locale somewhere ...


I think the language in your simulator is set to German. Than nachm. means Nachmittags. And that's equal to PM. Take a look at the settings in the simulator. ;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号