By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,641 Members | 2,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,641 IT Pros & Developers. It's quick & easy.

how to minus a date?

P: n/a
hello... can someone tell me how to minus a date value?
e.g. 17/01/2005 - 1 would be 18/01/2005

can someone show me how this is done?
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Maybe you're looking for the Date.Subtract method?

In VB.NET you could also use the DateDiff function.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Asha" <As**@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
hello... can someone tell me how to minus a date value?
e.g. 17/01/2005 - 1 would be 18/01/2005

can someone show me how this is done?

Nov 19 '05 #2

P: n/a
Those will do.

An alternate way would be to use the AddDays method
....and feed it a negative number ( -1 in this case ).

VB.NET
Public Function AddDays(ByVal value As Double) As DateTime

C#
public DateTime AddDays(double value);


Juan T. Llibre
ASP.NET MVP
===========
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ud****************@TK2MSFTNGP12.phx.gbl...
Maybe you're looking for the Date.Subtract method?

In VB.NET you could also use the DateDiff function.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Asha" <As**@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
hello... can someone tell me how to minus a date value?
e.g. 17/01/2005 - 1 would be 18/01/2005

can someone show me how this is done?


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.