UIDatePicker设置为24小时制
self.startDateView = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, screenHight - 300, screenWidth, 300)];
self.startDateView.backgroundColor = UIColor.whiteColor;
//设置本地时间为中国
self.startDateView.locale = [NSLocale localeWithLocaleIdentifier:@"ch"];
//日期显示格式
self.startDateView.datePickerMode = UIDatePickerModeTime;
//设置为24小时制
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_GB"];
self.startDateView.locale = locale;
self.startDateView.minimumDate = [NSDate date]; // 最小时间
[self.view addSubview:self.startDateView];
posted on 2018-09-26 18:51 yucaijiang 阅读(1196) 评论(0) 编辑 收藏 举报