1、获取当前系统时间,毫秒级
- (void)viewDidLoad {
[super viewDidLoad];
NSString *currentTime = [self getCurrentTime];
NSLog(@"%@",currentTime);
}
- (NSString *)getCurrentTime{
NSDateFormatter * formatter = [[NSDateFormatter alloc ] init];
[formatter setDateFormat:@"YYYY-MM-dd hh:mm:ss:SSS"];
NSString *date = [formatter stringFromDate:[NSDate date]];
return date;
}