I need to customize and localize the date format of a UIDatePicker
's DateAndTime
mode, so that it will display the date numbers in Arabic
language plus time in 24 hours format and in Arabic numbers too.
the equivalent row in English would be: 2017 11 15 17:00
I've tried all the solutions proposed on SO from changing the locale to changing device language but to no avail.
Let's breaking it down:
locale
:which means that setting the desired locale for changing the language also affects the format date of the date picker.
Roughly speaking, setting both language and format is unavailable for your case, you should choose the desired language or the desired date format.
However, applying the first point (changing the date picker locale):
should leads to the following output:
Also, the following question:
Show Time in 12 and 24 hour format in UIDatePicker on the basis of app settings not on device Settings
is also related to changing the date picker format.