D Dirk Reske Nov 27, 2003 #1 Hello, I have two dates. How can I check if the second date is the day after the first date? thx
P Peter Danielsson Nov 27, 2003 #2 Hello, Try something like this. Date1.AddDays(1).equals(Date2)) Peter
C Champika Nirosh Nov 28, 2003 #3 I think this way will do what he need .. if (DateTime.Compare(date1, date2) > 0) Console.Write("date1 > date2"); if (DateTime.Compare(date1, date2) == 0) Console.Write("date1 == date2"); if (DateTime.Compare(date1, date2) < 0) Console.Write("date1 < date2"); Nirosh.
I think this way will do what he need .. if (DateTime.Compare(date1, date2) > 0) Console.Write("date1 > date2"); if (DateTime.Compare(date1, date2) == 0) Console.Write("date1 == date2"); if (DateTime.Compare(date1, date2) < 0) Console.Write("date1 < date2"); Nirosh.
A Arild Fines Dec 9, 2003 #4 Dirk Reske said: Hello, I have two dates. How can I check if the second date is the day after the first date? Click to expand... The DateTime struct supports the >, <=, >= and < operators.
Dirk Reske said: Hello, I have two dates. How can I check if the second date is the day after the first date? Click to expand... The DateTime struct supports the >, <=, >= and < operators.