how to minus a date?

G

Guest

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?
 
S

Steve C. Orr [MVP, MCSD]

Maybe you're looking for the Date.Subtract method?

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

Juan T. Llibre

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
===========
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top