I am trying to get a date in the format Monday, March 09, 2015. But the following code does not return the required date format. I think I'm using the wrong Formatter. Here is the code:
NSString *dateString = @"09-03-2015"; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"dd MMMM yyyy"]; NSDate *date = [[NSDate alloc] init]; date = [dateFormatter dateFromString:dateString]; NSLog(@"%@",[dateFormatter stringFromDate:date]);
ios objective-c nsdate nsdateformatter
Idrees
source share