Dear Apple Support Team,
I am currently developing a control in my app that uses UIDatePicker for time input. To ensure that the time display format is consistently in 24-hour notation regardless of the region, I have set the locale of UIDatePicker to ‘systemLocale’.
However, while this worked as expected up to iPadOS15, displaying the time in 24-hour format, it has switched to a 12-hour format from iPadOS16 onwards. I am wondering if there have been any changes in the behavior of UIDatePicker’s locale between the updates from iPadOS15 to iPadOS16?
Additionally, I would like to know if there are any workarounds to this issue that do not involve modifying the program. In other words, is there a way to revert back to the 24-hour format without changing the code?
Any information you could provide on this issue would be greatly appreciated. Thank you for your assistance.
systemLocale
would default to 24-hour clock or 12-hour format depending on the user's region setting.
Have you tried using the using locale given by the currentLocale
or the autoupdatingCurrentLocale
property instead. You might need to specify a different local to UIDatePicker if you prefer a 24-hour clock over a 12-hour clock).
Specify a locale < https://developer.apple.com/documentation/uikit/uidatepicker#2281469 > cover this topic, I would recommend you review the article as well.