UIDatePicker *datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 20, 200, 30)];
datePicker.datePickerMode = UIDatePickerModeDate;//模式选择
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"];//设置为中文
datePicker.locale = locale;
 
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];//设置输出的格式
[dateFormatter setDateFormat:@"yyyy-MM-dd"];

相关文章:

  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2021-05-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
  • 2021-12-26
  • 2022-12-23
相关资源
相似解决方案