Could anyone explain this to me? I've seen quite a few DateFormatter issues around, and all seem to be related, but not exactly what I'm facing here.
Consider the following code:
NSString * CleanDate = @"20101117T020000-0000";
NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyyMMdd'T'HHmmssZ"];
NSDate * date = [dateFormatter dateFromString:cleanDate];
NSLog(@"CleanDate: %@, Date: %@",cleanDate, date );
The Log output on an iPhone Simulator is
CleanDate: 20101117T020000-0000, Date: (null)
while on the iPad Simulator it is
CleanDate: 20101117T020000-0000, Date: 2010-11-17 03:00:00 +0100
Same results on real devices. Interestingly, everything was working fine in the iPhone Simulator last night. I have reset the simulators to their defaults, changed time zones and languages, without any result.
Should I set something in my Project settings?