直接上代码: NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"HH:mm"]; NSDate *date = [dateFormatter dateFromString:@"00:00"]; _datePicker.date = date; 转载于:https://www.cnblogs.com/pretty-guy/p/4810335.html