NSDate *currentDate = [NSDate date];//获取当前时间,日期 NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"YYYY/MM/dd hh:mm:ss SS"]; NSString *dateString = [dateFormatter stringFromDate:currentDate]; NSLog(@"dateString:%@",dateString);
说明下格式对应