NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"yyyy-MM-dd'T'HH:mm";
NSTimeZone *gmt = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];
[dateFormatter setTimeZone:gmt];
NSString *timeStamp = [dateFormatter stringFromDate:[NSDate date]];
[dateFormatter release];
powinien to zrobić co trzeba:
NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
fmt.dateFormat = @"LLL d, yyyy - HH:mm:ss zzz";
NSDate *utc = [fmt dateFromString:@"June 14, 2012 - 01:00:00 UTC"];
fmt.timeZone = [NSTimeZone systemTimeZone];
NSString *local = [fmt stringFromDate:utc];
NSLog(@"%@", local);
Zwróć uwagę, że Twój przykład jest niepoprawny: gdy jest godzina 1 w dniu 14 czerwca w UTC, nadal jest 13 czerwca w EST, 8 wieczorem Oszczędności czasu letniego i 9-godzinnego. W moim systemie Ten program drukuje
Jun 13, 2012 - 21:00:00 EDT