views:

55

answers:

1

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 ...

+1  A: 

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. ;-)

Sandro Meier
General -> International -> Region Format -> United States (e.g.)I thought setting the language is enough. But it seems it isn't. Thanks.
testing
“10:30 nachmittags” is also absolutely uncommon since “nachmittags” normally is the time between noon and evening (10:30 P.M. is mostly __not__ “nachmittags”). I'm not sure if it exactly matches “afternoon” but it's an misleading translation of “P.M.”. Nevertheless in Germany the 24h representation is much more common.
Tilo Prütz