Android Question TimeFormat locale

noeleon

Active Member
Licensed User
how to set the locale of datetime.timeformat to English so it does not return time in the current device language like Arabic?
01:23.45 instead of ۰۰:۰۳.۱۳

Thanks.
 

LucaMs

Expert
Licensed User
Longtime User
upload_2019-11-29_15-17-21.png


DateTime.TimeFormat = "hh:mm:ss"

DateTime.TimeFormat = "h:mm a" to get AM or PM
 
Upvote 0

noeleon

Active Member
Licensed User
I'm using DateTime.TimeFormat = "mm:ss.SS"

The problem is if I set the device language to Arabic the time returned by datetime becomes Arabic numbers too.
 
Last edited:
Upvote 0

noeleon

Active Member
Licensed User
This is what I'm going to do: Set locale in my app to US and then switch to Arabic only during text input then switch back to US right after, using this
B4X:
Dim jo As JavaObject
jo.InitializeStatic("java.util.Locale").RunMethod("setDefault", Array(jo.GetField("US")))
 
Upvote 0
Top