How to compare DateTime in C#?To compare 2 dates in C# you can use method
Compare(param1, param2)part of class
DateTimewhich takes 2 dates as parameter and return an integer value of:
1) Value -1 means before/earlier date.
2) Value 0 means equal/ same date.
3) value 1 means after/later date.
date1 is earlier than date2