Android Question Convert 5 to 05 in Label or EditText

arvin

Member
I have to show a clock like this 05:03 AM in a label but it shows like this: 5:3 Am. how shall i do this?
 

sorex

Expert
Licensed User
Longtime User
where is the time coming from?

here's when you using the device time

B4X:
DateTime.TimeFormat="HH:mm a"
log(DateTime.Time(DateTime.Now))
 
Upvote 0

arvin

Member
where is the time coming from?

here's when you using the device time

B4X:
DateTime.TimeFormat="HH:mm a"
log(DateTime.Time(DateTime.Now))
impressive question is comes from an ESP8266 , it comes like in BYTE format, How can I from time like this 3:15 to this function? not "DateTime.NOW"
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
B4X:
Dim t As String="3:50"
Dim data() As String=Regex.Split(":",t)
Log( NumberFormat(data(0),2,0) &":"& NumberFormat(data(1),2,0) )
 
Upvote 0
Top