I noticed a nifty setting in the xcode simulator while running that I can change the current location and hence simulate location based tests
However, when I try to get the date using NSDateFormatter, the local date is still in PST. I am in the Pacific Time Zone
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateStyle:NSDateFormatterMediumStyle]; // Jan 1, 2010
[dateFormatter setTimeStyle:NSDateFormatterShortStyle]; // 1:43 PM
NSLocale *usLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
[dateFormatter setLocale:usLocale];
[usLocale release];
NSDate *testDate = [NSDate date];
NSLog(@"Local date: %@", [dateFormatter stringFromDate:testDate]);
According to the docs, stringFromDate should use the receivers current setting, which should use the timeZone of the Tokyo, Japan.
Is this expected?