Skip to content

Instantly share code, notes, and snippets.

Last active Oct 1, 2021
What would you like to do?
UIDatePicker *datePicker = [[UIDatePicker alloc] init];
// 言語は日本語(iOSの設定の書式に該当)
datePicker.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"ja_JP"];
// カレンダーは西暦(iOSの設定のカレンダーに該当)
NSCalendar *gregorian = [[NSCalendar alloc]initWithCalendarIdentifier:NSGregorianCalendar];
gregorian.locale = [NSLocale currentLocale];
datePicker.calendar = gregorian;
datePicker.datePickerMode = UIDatePickerModeDateAndTime;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment