DateAdd

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello:

I know DateAdd is not a part of the C# language: but I can't seem to figure
out how to implement the same funtionality. I want to be do something like:

dDate = DateAdd(-1, dResquestedDate)

where -1 is the number of days I would like to add
dRequestedDate is the date I would like to add days to.

Would anyone be able to provide some insight or help?

Thanks
Andy
 
A> I know DateAdd is not a part of the C# language: but I can't seem to
A> figure out how to implement the same funtionality. I want to be do
A> something like:
A>
A> dDate = DateAdd(-1, dResquestedDate)

dDate = dRequestedDate + new TimeSpan(...) ?
 
Try something like:
DateTime today = DateTime.Now;
DateTime yesterday = today.AddDays(-1);
 
Back
Top