Retrieve date and time from UIDatePicker iOS
10,452
NSDate *myDate = datePicker.date;
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"cccc, MMM d, hh:mm aa"];
NSString *prettyVersion = [dateFormat stringFromDate:myDate];
Author by
Ali Shahid
Updated on June 15, 2022Comments
-
Ali Shahid almost 2 years
I want to retrieve date and time in format e.g "Friday May 31, 2013 12:00 pm". How can I achieve that with NSDateFormatter?