Click here to Skip to main content
15,894,540 members
Please Sign up or sign in to vote.
1.08/5 (6 votes)
See more:
how to calculate next 3 month for date in textbox ?
Posted
Updated 18-Sep-14 21:08pm
v3
Comments
kavitha3 19-Sep-14 2:20am    
Hi Rupesh.!
Can u please make the Question[issue] a bit clear?
Thanks7872 19-Sep-14 3:03am    
Question should be only in english. Don't you know that this is english site?

Are you looking for like :

Two weeks after today's date:
C#
DateTime.Now.Date.AddDays(2*7)


Or

Three months after today's date:
C#
DateTime.Now.Date.AddMonths(3)
 
Share this answer
 
v2
Hi
Suppose you get the date from text box is "01/01/2013" the in
C# code you can use

string date = txt
C#
fname.Text.ToString();  // you text box date
            var d = date.Split('/');
            int day =Convert.ToInt16(  d[0]);
            int month =Convert.ToInt16(  d[1]);
            int year =Convert.ToInt16( d[2]);

            DateTime newdate =new DateTime(year, month, day).AddMonths(3);


I hope it helps you .
thank you
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900