I’m trying to change the date format I get from my webservice to a friendlier format, this is what I do:
NSDateFormatter *currentFormat = [[NSDateFormatter alloc] init];
currentFormat.dateFormat = @"yyyy-mm-dd HH:mm:ss";
NSDate *date = [currentFormat dateFromString:[voicenote valueForKeyPath:@"Voicenote.created"]];
NSLog(@"%@", [currentFormat stringFromDate:date]);
NSDateFormatter *friendlyFormat = [[NSDateFormatter alloc] init];
friendlyFormat.dateFormat = @"EE, d LLL yyyy HH:mm";
But when I go to print it out, initially the date is fine, but when I change it to the friendly format they’re all January.
Check your dateformat strings, especially the capitalization of the m.