0

I am doing the application with UIDatePicker for time format. It is working in 12hrs format, If i change the iPhone date/time to 24hrs format, I need to display only 12hrs format, not the 24hrs format.

Is there anyway to disable the 24hrs format?

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
NewbieiOS
  • 81
  • 1
  • 1
  • 11

1 Answers1

2

Use this code for 12 hour format

NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"US"];
[self.datePicker setLocale:locale];

Use this code for 24 hour format

NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"NL"];
[self.datePicker setLocale:locale];
Pranav
  • 701
  • 4
  • 18