It seems that VB6 can't correctly compare dates in some situations. Are there any solutions to this?
Private Sub CheckDate()
date1 = #7/6/2010 2:00:00 PM#
Debug.Print "Date 1: " + CStr(date1)
date2 = DateAdd("h", -8, #7/6/2010 10:00:00 PM#)
Debug.Print "Date 2: " + CStr(date2)
Debug.Print "Equal? " + CStr(date1 = date2)
End Sub
The correct output should be:
Date 1: 7/6/2010 2:00:00 PM
Date 2: 7/6/2010 2:00:00 PM
Equal? True
but the real output is:
Date 1: 7/6/2010 2:00:00 PM
Date 2: 7/6/2010 2:00:00 PM
Equal? False
Is there any way around this, or is there any way to avoid this situation (whatever it is)?