获取当前准确时间

NSDate *date = [NSDate date];
NSTimeZone *zone = [NSTimeZone systemTimeZone];
NSTimeInterval interval = [zone secondsFromGMTForDate:date];
NSDate *current = [date dateByAddingTimeInterval:interval];
NSDate *date = [NSDate date];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
NSString *currentString = [formatter stringFromDate:date];

参考链接:http://www.jianshu.com/p/5f4e7fabcc02

你可能感兴趣的:(获取当前准确时间)