获取当前时间的简单方法
2016-06-27 本文已影响31人
16哥哥
NSDate *currentDate = [NSDate date];//获取当前时间,日期
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY-MM-dd hh:mm:ss SS"];
NSString *dateString = [dateFormatter stringFromDate:currentDate];