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];

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2022-02-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2021-09-14
  • 2022-12-23
相关资源
相似解决方案