I discovered a very interesting little twist on the differences between the Today property and the Now property in the DateTime Class. I was working on something recently and using the built-in Compare method of the DateTime Type. Essentially the user selected a date and I had a validation snippet that was supposed to check that they had not picked a future date. One of the ways they could choose their date was via a DateTimePicker control. I thought that this code might do the trick:
Dim EndDate As DateTime
Dim Current As DateTime = Today
If DateTime.Compare(Current, EndDate) < 0 then
label6.text ="" "CONTRACT EXPIRED LESS THAN"
end if
if datetime.compare(current, enddate) ="" 0 then
label6.text ="" "CONTRACT EXPIRED EQUALS"
end if
if datetime.compare(current, enddate) > 0 Then
Label6.Text = "CONTRACT NOT EXPIRED GREATER"
End If






