Trying to format the date in iOS 7 and get unexpected results for the day of the week. Apple's documentation does not display templates for iOS 7, but the templates provided for iOS 6 are here . Looking at the weekly section of the week
Day of the week — Use one to three letters in a short day, or four for a full name or five for a narrow name.
However, I can not get the format string with the full name of 4 letters.
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"EEE"];
NSLog(@"%@", [formatter stringFromDate:date]);
prints "Wed"
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"EEEE"];
NSLog(@"%@", [formatter stringFromDate:date]);
also prints "Wed", should print "medium"
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"EEEEE"];
NSLog(@"%@", [formatter stringFromDate:date]);
prints "W"
Is there a new set of formatting strings that should be used for iOS 7, or am I doing something wrong?
source
share