[Objective-C] 纯文本查看 复制代码 //给UIDatePicker设置date
-(void)textFieldDidBeginEditing:(UITextField *)textField{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"HH:mm";
NSDate *date = [formatter dateFromString:self.text];
[self.picker setDate:date];
}
为什么"00:00"这个字符串会被转换为上午12:00 ?
|