This strange issue appeared with ios 8 release. Here is sample 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 is 2014-11-01 00:00:00 MSK
(or 2014-10-31 20:00:00 +0000
)
Running ios 7, month value is 11. But on ios 8 it is 10. Any ideas what's wrong? Thanks.
PS. Checking Asia/Muscat timezone right now (+4 like MSK). Everything is OK, month is 11.
[timezone secondsFromGMTForDate:date]
returns 14400 at iOs7 and 10800 at iOs8 for the given date. It should reflect the changes done (again) by the russian government http://www.timeanddate.com/time/change/russia/moscow which iOs7 isn't aware of yet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With