VB.NET Calculate Date Difference
Posted on 2008-10-10
I know there must be an easier way to calculate difference between dates or if one date is less than another. Problem is I am trying to calculate a date in at text box against Date.Now.
This does not work.
If CDate(Me.TextBox1.Text) < Date.Now Then
MessageBox.Show("Date is less than" & Date.Now, "Date", MessageBoxButtons.OK, MessageBoxIcon.Information)
This also does not work.
Dim strDateDiff As String = DateDiff(DateInterval.Day.ToString(), Me.TextBox1.Text, Date.Now)