How can I determine whether a device is using 12 o

2019-02-11 14:00发布

I want to know the current device time format.

means 24 hour/ 12 hour format .

Plz let me know how can I determine that.

Are there any API there to determine this.

thanks.

2条回答
手持菜刀,她持情操
2楼-- · 2019-02-11 14:17

String value = android.provider.Settings.System.getString(context.getContentResolver(), android.provider.Settings.System.TIME_12_24);

Updated Answer, you should use this instead of the above, as above could give back a null value:

DateFormat.is24HourFormat(context)
查看更多
登录 后发表回答