datetime format

Bhabani prasad Dash

Bhabani prasad Dash

Jun 5 2013 7:04 AM
i have a text box.in whic i want to entry the no of month.
after that there is two text box from date textbox and To date text box.
when i entry month in month text box from date is fixed i.e current date i want to add the no of month which entry on month text box
EX-05/06/2013 i entry on 6 on month text box then it will automatic show 05/12/2013 in to text box how i add date plz help me

           int p = Convert.ToInt32(txt_warrantyeriod.Text);       
          txt_start.Text = DateTime.Now.ToString("dd-MMM-yyyy");
          txt_end.Text = DateTime.Now.AddMonths(p).ToString("dd-MMM-yyyy");

Answers (8)