I have this date string - "2011-07-04T00:00:00"
, and I would like to display the date as "July 7, 2011"
This is the code I'm using to convert the date string to the formatted date string -
NSDateFormatter* formatter = [[NSDateFormatter alloc]init];
[formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:SS"];
NSDate *date = [f dateFromString:@"2011-07-04T00:00:00"];
[formatter setDateStyle:NSDateFormatterLongStyle];
NSString* formattedDate = [formatter stringFromDate: date];
Is this the best way?