Reputation: 6278
I know this post is maybe triplicate or so, but none of the answers on existing threads helped me so far.
I'm trying to get NSDate value from string, but I'm constantly getting nil as a result. This is my code
NSString * dateString = cell.lblAlertDate.text;//this value is "06/11/2013 23:55" for example
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]];
[dateFormatter setDateFormat:@"MM/dd/yyyy HH:mi"];
self.selectedAlarmDate = [dateFormatter dateFromString:dateString];
Upvotes: 1
Views: 605
Reputation: 52237
[dateFormatter setDateFormat:@"MM/dd/yyyy HH:mm"];
what is the i
doing there …
Upvotes: 3