Date Calculation
I need to know one thing. Suppose, date is october 1 2008(1.10.2008). If 30 days is added to that date then the result will be 31.10.2008. How could do that automatically using C#.net
I need help regarding this problem.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mamta MPosted Oct 22, 2008, 8:21 AM
Hi,
The following code should help you in this regard:
DateTime firstdate;
firstdate = Convert.ToDateTime("10/01/2008");
DateTime newdate= firstdate.AddDays(30);
// if you want to display the date
Console.WriteLine(newdate.ToString());
// or else do some other action