How to change the format of date in date picker

前端 未结 3 1984
深忆病人
深忆病人 2020-11-28 16:30

In my iPhone app, I need to display date in yyyy/MM/dd format as show in beloow image

3条回答
  •  眼角桃花
    2020-11-28 17:14

    In Apple's documentation they specified that in UIDatePickerModeDate. The DatePicker displays months, days of the month, and years. The exact order of these items depends on the locale setting. An example of this mode is [ November | 15 | 2007 ]. But In device it display as DD/MM/YYYY. See UIDatePicker for more info.

    So if you want to do it yourself you could create your own UIPickerView with the values you want.

提交回复
热议问题