获取当地时间
NSDate *date = [NSDate date];
方法一
NSTimeZone *zone = [NSTimeZone systemTimeZone];
NSInteger interval = [zone secondsFromGMTForDate: date];
NSDate *localeDate = [date dateByAddingTimeInterval: interval];
NSLog(@"%@", localeDate);
方法二
NSDateFormatter *dateformatter = [[NSDateFormatter alloc] init];
[dateformatter setTimeZone:[NSTimeZone localTimeZone]];
[dateformatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSString *str = [dateformatter stringFromDate:date];
NSLog(@"%@", str);