Question : C# - operation on date

Hello,

I have the following variables i get from user:
day: 29
month: 6
year:2009
delta(in days): 90

Then I should do:
Add delta in days: 29/6/2007 + 90days = 29/9/2009.
And compare it to the current date today.
29/9/2009   ???   24/11/2009
How to implement it?

THANKS

Answer : C# - operation on date

here:
1:
2:
3:
4:
static int Compare(int day, int month, int year, int delta)
        {
            return DateTime.Now.CompareTo(new DateTime(year, month, day).AddDays(delta));
        }
Random Solutions  
 
programming4us programming4us