iOS-获取的NSDate date时间与实际相差8个小时解决方案

NSDate *date = [NSDate date];
NSTimeZone *zone = [NSTimeZone systemTimeZone];
NSInteger interval = [zone secondsFromGMTForDate: date];
NSDate *localeDate = [date  dateByAddingTimeInterval: interval]; 
NSLog(@"enddate=%@",localeDate);

你可能感兴趣的:(iOS-获取的NSDate date时间与实际相差8个小时解决方案)