Compare two DateTime values
Imports System Class Sample Public Shared Sub Main() Dim k1 As DateTime = now, k2 As DateTime = now Console.WriteLine(k1.CompareTo(k2)) Console.WriteLine(k1.CompareTo(CObj(k2))) End Sub 'Main End Class