Android: How to change the DatePicker view date format from MM/dd/yyyy to dd/MM/yyyy?

后端 未结 2 1467
温柔的废话
温柔的废话 2020-11-29 09:30

I have been trying to get an answer to this question for quite a while. I also had a look at the following link: Android - DatePicker Widget Format. On my phone/ emulator (

2条回答
  •  误落风尘
    2020-11-29 10:24

    That setting is very specific. It is only meant to apply to dates dates shown in "short format". As long as you're using anything else (in this case, the DatePicker seems to be using "medium"), then those settings will be disregarded and the Locale's default formatting will take over.

    I can confirm that if you change your phone's the language (and, effectively, the Locale) the order of the elements does changes in the date picker. Which I guess means I disagree with Dan S's assertion that "the system does not use any mechanism to localize the DatePicker". If you look at the code, you can see that (at least since 2.1), there's a reorderPickers() method that does exactly this.

    English: English

    French: French

提交回复
热议问题