How can I compare two times in VB.net

Web Worm picture Web Worm · Apr 8, 2010 · Viewed 47.5k times · Source

I want to compare two times in VB.net:

I have 1:42:21 PM and I want it to compare with TimeOfDay in VB.net how can I do that?

Answer

mmx picture mmx · Apr 8, 2010
New DateTime(1, 1, 1, 13, 42, 21) > TimeOfDay

Or you can enclose a DateTime expression in # signs:

TimeOfDay > #1:42:21 PM#