This strange problem appeared with the release of ios 8. Here is an example code:
NSDate * date = [NSDate dateWithTimeIntervalSince1970:1414785600]; dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"ru_RU"]]; [dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"Europe/Moscow"]]; [dateFormatter setDateStyle:NSDateFormatterFullStyle]; [dateFormatter setDateFormat:@"MM"]; NSString * month = [dateFormatter stringFromDate: date];
Date 2014-11-01 00:00:00 MSK (or 2014-10-31 20:00:00 +0000 )
Running ios 7, the value of the month is 11. But on ios 8 it's 10. Any ideas what is wrong? Thanks.
PS. Check the time zone of Asia / Muscat right now (+4, like MSK). Everything is in order, the month is 11.
source share