如上图,下午两点22 ,得到的是早上6点22,不一致,如何解决呢?
NSDate *date = picker.date;
NSTimeZone *timeZone=[NSTimeZonesystemTimeZone];
NSInteger seconds=[timeZonesecondsFromGMTForDate:date];
NSDate *newDate=[datedateByAddingTimeInterval:seconds];
NSLog(@"%@",newDate);
NSString *str = [NSStringstringWithFormat:@"%@",newDate];
str = [str substringToIndex:16];
NSLog(@"%@",str);
转换后的,str 即为