hi
I recently coded a program which displays the timespan between 2 different times. I used the DateTime function to do this but now i can't calculate the speed as you cannot use DateTime in division, is there another function i should use?
This is my code so far:
I recently coded a program which displays the timespan between 2 different times. I used the DateTime function to do this but now i can't calculate the speed as you cannot use DateTime in division, is there another function i should use?
This is my code so far:
Code:
Public Class Form1
Dim starttime As DateTime
Dim endtime As DateTime
Dim timetaken As TimeSpan
Dim registration As String
Dim Distance As Integer
Dim speed As Decimal
Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
starttime = DateTime.Parse(txtStart.Text)
endtime = DateTime.Parse(txtEnd.Text)
timetaken = endtime - starttime
registration = txtReg.Text
Distance = 500
speed = Distance / timetaken
End Sub
End Class
Comment