Carlos Sanchez

Carlos Sanchez

  • NA
  • 264
  • 0

How to Increase a Date?

Jan 11 2005 1:13 PM
How can I add 1 day to a Date. I've tried this: MyDate.Add(new TimeSpan(1,0,0,0)) but it doesn't work. I'm using it into a while statement, like this: MyDate = DateTime.Now; FinalDate = dtpFinalDate.Value; while (MyDate <= FinalDate) { //Statement MyDate.Add(new TimeSpan(1,0,0,0)) } what am I doing wrong? thanx in advance.

Answers (3)