Hi
I need the decimal to 1 decimal place for the difference in two times
I have this code
B4X:
Label13.text = DateTime.Time(DateTime.Now)
Label13.Enabled = False
Dim x, y, z As Long
x = DateTime.TimeParse(Label13.text)
y = DateTime.TimeParse(Label12.text)
z = x - y
Label15.Text = z
for a 1 sec difference in time
z = 1000
What I am looking for is a formula that converts the variance into a decimal hr
eg
150 min = 2.5hrs
80 min = 1.3hrs
Can you elaborate on what you mean by '1 decimal place' in relation to time? As far as I know there are no decimal places in time unless you mean 6.5 hours or something like that.
Label13.text = DateTime.Time(DateTime.Now)
Label13.Enabled = False
Dim x, y, z As Long
x = DateTime.TimeParse(Label13.text)
y = DateTime.TimeParse(Label12.text)
z = x - y
Label15.Text = Round2(z/60000/60,1)
/60000 converts it to min /60 converts to decimal hrs
round2( ,1) rounds to 1 decimal place