DateTime.Compare
is used to check if the 2 DateTime parameters are equal or not. For this one, you might want to consider using the
Hour
property for your scenario. A high level approach would be to subtract
Logout.Hour
to
Login.Hour
and the check if the result is greater than 3. Refer
here[
^] for details.