A arvin Member Jan 23, 2020 #1 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?
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?
Erel B4X founder Staff member Licensed User Longtime User Jan 23, 2020 #2 You can use NumberFormat for this. However there is some missing information here. DateTime.Time(DateTime.Now) should also work. Upvote 0
You can use NumberFormat for this. However there is some missing information here. DateTime.Time(DateTime.Now) should also work.
I IdasI4A Active Member Licensed User Longtime User Jan 23, 2020 #3 you've tried this: B4X: DateTime.TimeFormat="HH:mm a" Log(DateTime.Time(DateTime.Now)) Upvote 0
S sorex Expert Licensed User Longtime User Jan 23, 2020 #4 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
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))
A arvin Member Jan 23, 2020 #5 sorex said: 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)) Click to expand... 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 said: 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)) Click to expand... 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"
S sorex Expert Licensed User Longtime User Jan 23, 2020 #6 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
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) )