how to minus a date?

  • Thread starter Thread starter Guest
  • Start date Start 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?
 
Maybe you're looking for the Date.Subtract method?

In VB.NET you could also use the DateDiff function.
 
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

Back
Top