Get datetime value from X days go?

001 picture 001 · Dec 23, 2012 · Viewed 46.2k times · Source

Possible Duplicate:
c#: whats the easiest way to subtract time?

I want

MyNewDateValue = MyDateNow - MyDateInteger;

Example Today is the 22nd of December 2012

If MyDateIneger value is 120, MyNewDateValue, will return the datetime 120 days ago.

Answer

Jason Whitted picture Jason Whitted · Dec 23, 2012
MyNewDateValue = MyDateNow.AddDays(-MyDateInteger);