Reputation: 295
How to make UIDateTimePicker with only Date and hour and am/pm.(NO MINUTES OR SECONDS TO DISPLAY !)
Upvotes: 1
Views: 988
Reputation: 2355
_datepicker.datePickerMode= UIDatePickerModeDate;
[_datepicker reloadInputViews];
Upvotes: 0
Reputation: 932
Change the mode of the DatePicker
from the storyboard. Find attached screenshot.
NSDate * date = picker.date;
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"d:hh a"];
NSLog(@"picker time: %@", [df stringFromDate:[NSDate date]]);
Here picker is the IBoutlet reference for UIDatePicker
.
Upvotes: 2