android – How can I determine whether a device is using 12 or 24-hour time format?-ThrowExceptions

Exception or error:

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.


How to solve:

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:



This may help you….

The link of the answer source:

Leave a Reply

Your email address will not be published. Required fields are marked *