I have two DateTime objects: StartDate and EndDate. I want to make sure StartDate is before EndDate. How is this
DateTime
StartDate
EndDate
You can use the overloaded < or > operators.
For example:
DateTime d1 = new DateTime(2008, 1, 1); DateTime d2 = new DateTime(2008, 1, 2); if (d1 < d2) { ...