MuSTaNG's answer says it all, but I'm still adding it to make it a little more complicated, with links and all.
Common operators
Available for DateTime with the .NET Framework 1.1. In addition, adding and subtracting DateTime objects is also possible using the usual + and - operators.
One example from MSDN:
Equality: System.DateTime april19 = new DateTime(2001, 4, 19); System.DateTime otherDate = new DateTime(1991, 6, 5); // areEqual gets false. bool areEqual = april19 == otherDate; otherDate = new DateTime(2001, 4, 19); // areEqual gets true. areEqual = april19 == otherDate;
Other operators can be used in a similar way.
Below is a list of all the operators for DateTime .
Sđđoshƒaӽ Oct 25 '16 at 6:55 2016-10-25 06:55
source share