I'm having issues using NSDateFormatter when the user isn't using the Gregorian calendar as their default calendar for the iPhone.
NSString *testString = @"2011-01-14";
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyy-MM-dd"];
NSDate *eventDate = [dateFormat dateFromString:testString];
[dateFormat setDateFormat:@"yyyy-MM-dd(EEE)"];
NSString *dateAndLocString = [dateFormat stringFromDate:eventDate];
[dateFormat release];
On a device using the Gregorian calendar dateAndLocString will be equal to 2011-01-13(Thu) But when the user is using the Japanese calendar dateAndLocString will be equal to 2011-01-13(Wed), which is wrong.
Anyone have any idea what I might be doing incorrectly?