How to disable or hide AM/PM in UIDatePicker from code / interface builder? I want to have 24 hours time picker mode in UIDatePicker. Please help
AFAIK you can't (within limits of SDK). The AP/PM will disappear if the user chooses to use 24-hour format. Make your own UIPickerView
in case this is important.
According to the documentation you should be able to set the locale
property of UIDatePicker to a locale that uses a 24 hrs format.
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"da_DK"];
[datePicker setLocale:locale];
[locale release];
Alas there is a bug causing both simulator and device to continue to layout the date picker according to the users international preferences.
As you suggest, you have to roll your won date picker to be able to display a 24 hrs picker.
As answered here http://stackoverflow.com/questions/1151335/can-i-localize-a-uidatepicker/2265984#2265984 and here http://stackoverflow.com/questions/2894161/uidatepicker-problem-localizing/2918507#2918507, the picker display depends on country settings, not on language settings.
In your example you are changing the language locale only.