Here is the date sample: Wed, 13 May 2015 16:10:00 CEST
My formatter aint working
@"EEE, dd MMM yyyy HH:mm:ss vvvv"
What should i change?
UPD: full code
NSString* formattedDayWithString(NSString* date){
NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init];
NSLocale *locale = [NSLocale currentLocale];
NSString *localeId = [locale displayNameForKey:NSLocaleIdentifier
value:[locale localeIdentifier]];
SLog(@"%@ date:%@", localeId, date);
[inputFormatter setLocale: locale];
[inputFormatter setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss vvvv"];
NSDate *formattedDate = [inputFormatter dateFromString: date];
NSDateFormatter *outputFormatter = [[NSDateFormatter alloc]init];
[outputFormatter setDateFormat:@"d'.' MMMM yyyy"];
NSString* dateStr = [[NSString alloc] initWithFormat: @"%@",[outputFormatter stringFromDate:formattedDate]];
return dateStr;
}