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