iOS 设置UIDatePiicer为24小时制

直接上代码:

NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"HH:mm"];
    
    NSDate *date = [dateFormatter dateFromString:@"00:00"];
    
    
    _datePicker.date = date;

 

你可能感兴趣的:(iOS 设置UIDatePiicer为24小时制)