how to minus a date?

Discussion in 'ASP .Net' started by =?Utf-8?B?QXNoYQ==?=, Jan 18, 2005.

  1. 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?
     
    =?Utf-8?B?QXNoYQ==?=, Jan 18, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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?
     
    Steve C. Orr [MVP, MCSD], Jan 18, 2005
    #2
    1. Advertising

  3. 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]" <> wrote in message
    news:ud2%235Xb$...
    > 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" <> wrote in message
    > news:...
    >> 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?

    >
    >
     
    Juan T. Llibre, Jan 18, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mm
    Replies:
    1
    Views:
    6,150
  2. =?Utf-8?B?Q2hyaXM=?=

    getfiles, minus the path?

    =?Utf-8?B?Q2hyaXM=?=, Dec 29, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    519
    Ken Cox [Microsoft MVP]
    Dec 30, 2004
  3. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,379
    Michael Borgwardt
    May 30, 2004
  4. laredotornado
    Replies:
    4
    Views:
    20,989
    Roedy Green
    Oct 6, 2008
  5. joeandtel

    minus one date from another

    joeandtel, Feb 4, 2004, in forum: ASP General
    Replies:
    1
    Views:
    226
    Aaron Bertrand - MVP
    Feb 4, 2004
Loading...

Share This Page