I am trying to parse a date like this: 2012-10-20T13:45:00+002
with this code:
NSDateFormatter* formatter = [[NSDateFormatter alloc]init];
[formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZZZ"];
NSDate *date = [formatter dateFromString:@"2012-10-20T13:45:00+002"];
But when I try to output it on a device that its timezone is already +2 using this:
NSDateFormatter *dateformatter = [[NSDateFormatter alloc] init];
[dateformatter setDateFormat:@"HH:mm"];
dateformatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"ar_EG"];
cell.infoLabel.text = [dateFormatter stringFromDate:date];
The output is: 15:43 instead of 13:45 as it should be. Any help would be appreciated. PS: I'm running iOS5/6, Xcode 4.5 on iPhone and I tried on both simulator and a physical device.