The string which comes from my data source is formatted like this:
2011-04-11 23:12:05
// dateString comes from my data
// set norwegian locale
dateFormatter.locale=[[NSLocale alloc] initWithLocaleIdentifier:@"no_NO"];;
dateFormatter.dateFormat=@"MMMM";
NSString * monthString = [[dateFormatter stringFromDate:date] capitalizedString];
NSLog(@"month: %@", monthString);
This is a norwegian example. With your language it should be "se_SE"
A date format string of @"MMMM"
means that the string you're trying to parse is the full name of a month ("January", "October", etc).
You want something more like:
yyyy-MM-dd HH:mm:ss
Check out the date formatting patterns for more info.