469,362 Members | 2,295 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,362 developers. It's quick & easy.

DateAdd

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
Nov 16 '05 #1
3 40637
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(...) ?

--
Serg
Nov 16 '05 #2
Try something like:
DateTime today = DateTime.Now;
DateTime yesterday = today.AddDays(-1);
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Andy" <An**@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
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

Nov 16 '05 #3
SB
http://msdn.microsoft.com/library/de...classtopic.asp

-sb

"Andy" <An**@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
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

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by lofty | last post: by
4 posts views Thread by Ĝyvind Isaksen | last post: by
reply views Thread by Zlatko Matiĉ | last post: by
2 posts views Thread by Abdul N K | last post: by
3 posts views Thread by Annette Massie | last post: by
4 posts views Thread by ey.markov | last post: by
1 post views Thread by C.Davidson | last post: by
2 posts views Thread by Rich Raffenetti | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.