Android Question is phone set to 24h or 12h?

ilan

Expert
Licensed User
Longtime User
hi

how can i know if the device system clock is set to 12h or 24h?

i try it like this:

B4X:
Dim jo As JavaObject = DateTime
jo.InitializeContext
Log(jo.GetField("is24HourFormat"))

but i get an error (java.lang.RuntimeException: Field: is24HourFormat not found in: www.sagital.mysalarynew.main)

from what i see it should be available in DateFormat object but how to do it in b4a?

https://developer.android.com/reference/android/text/format/DateFormat.html

thanks, ilan

EDIT: maybe this may be helpful: http://www.programcreek.com/java-ap....text.format.DateFormat&method=is24HourFormat
 
Last edited:

mangojack

Expert
Licensed User
Longtime User
Try .. Phone.GetSettings("time_12_24") 'To check if 12 or 24h display Is enabled on your device.
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
Try .. Phone.GetSettings("time_12_24") 'To check if 12 or 24h display Is enabled on your device.

thank you this is working :)

i am trying to get the list of available keys for the .GetSettings method but i get a 404 error (page was not found)
where can i get the list of all keys?

thank you
 
Upvote 0
Top