Hi all im using a date picker and priting the time taken from picker in a label.It is working fine.and i want to print the AM/PM selected from picker.is it possible.Can anyone help me..Thanks in advance
I used the code below:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"hh-mm"];
selected = [datePicker date];
NSLog(@"saaa%@",selected);
NSString *dateString = [dateFormatter stringFromDate:selected];
NSString *message = [[NSString alloc] initWithFormat:@"Daily Reminder: %@", dateString];
[dateFormatter release];
label.text=message;
Yes, change this:
[dateFormatter setDateFormat:@"hh-mm"];to this:
[dateFormatter setDateFormat:@"hh-mm a"];