-
Computing Time
======================
The value of TextBox1 is 10:24:23 AM and the value of TextBox2 is 11:32:54 AM.
I am trying to compute the time in VB.NET and I tried this code;
Dim a As Date
Dim b As Date
Dim c As Date
a = TextBox1.Text
b = TextBox2.Text
c = (a - b)
MessageBox.Show(Format(c, "hh:mm:ss"))
But I encounter the error: Operator '-' is not defined for types 'Date' and 'Date'
What's the best thing to do?
-
Hi Kabayan,
Try to look at DateDiff function.
-
There is also a Date.Substract function I think....