R Renegade Member Licensed User Longtime User Aug 25, 2012 #1 Hi I need the decimal to 1 decimal place for the difference in two times I have this code Code: Copy 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 Can anyone help Thanks
Hi I need the decimal to 1 decimal place for the difference in two times I have this code Code: Copy 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 Can anyone help Thanks
T Tom Law Active Member Licensed User Longtime User Aug 25, 2012 #2 Try using a float value instead of a long. Upvote 0
R Renegade Member Licensed User Longtime User Aug 25, 2012 #3 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 and so on Upvote 0
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 and so on
thedesolatesoul Expert Licensed User Longtime User Aug 25, 2012 #4 Renegade said: I need the decimal to 1 decimal place for the difference in two times Click to expand... 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. Upvote 0
Renegade said: I need the decimal to 1 decimal place for the difference in two times Click to expand... 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.
R Renegade Member Licensed User Longtime User Aug 25, 2012 #5 It OK Solved it Code: Copy 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 Thanks all anyway Upvote 0
It OK Solved it Code: Copy 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 Thanks all anyway