Hi Manny,
Just used AddDays. For previous days, use a negative integer.
Here's some sample code:
System.DateTime tempDate;
tempDate=Calendar2.TodaysDate;
tempDate=tempDate.AddDays(30);
Response.Write(tempDate.ToShortDateString() + "<br>");
tempDate=Calendar2.TodaysDate;
tempDate=tempDate.AddDays(-30);
Response.Write(tempDate.ToShortDateString() + "<br>");
Does this help?
Ken
Microsoft MVP [ASP.NET]
"Manny Chohan" <Ma*********@discussions.microsoft.com> wrote in message
news:E2**********************************@microsof t.com...
Hey Guys, got a simple question: I am using C#
I am extracting date from the calendar control as follows.
tempDate=Convert.ToDateTime(Calendar2.TodaysDate.T oShortDateString());
Can someone tell me how i can add and subtract 30 days from it?
Thanks
Manny