ios 获取当前时间
//获取当前日期 NSDate* date = [NSDate date]; NSDateFormatter* dateFormat = [[NSDateFormatter alloc] init]; [dateFormat setDateFormat:@"HH:mm"]; NSString* dateStr = [dateFormat stringFromDate:date]; NSLog(@"当前时间%@",dateStr);
//获取当前日期 NSDate* date = [NSDate date]; NSDateFormatter* dateFormat = [[NSDateFormatter alloc] init]; [dateFormat setDateFormat:@"HH:mm"]; NSString* dateStr = [dateFormat stringFromDate:date]; NSLog(@"当前时间%@",dateStr);
发表回复