selvi subramanian

selvi subramanian

  • NA
  • 799
  • 558.9k

add days to another day

Jul 21 2014 1:58 AM

1/07/2014

here 07 is month

01 is date


my code is

textbox18 is date retrieved from database in database the date is saved like dd/MM/yyyy format.

1
2
3
DateTime addonday = Convert.ToDateTime(TextBox18.Text);
addonday = addonday.AddDays(1);
TextBox20.Text = addonday.ToString("dd/MM/yyyy");

my output is like this

08/01/2014 (1 is add with month ) my need is that 1 is add with the date

01/07/2014 (1 is date 7 is month ) my need is (02/07/201)

but output cum like this (08/01/2014)


Answers (6)