Computing a Date

Is there a way to automatically compute a new date form knowing a curring date and an offset in days.  For example, say I pass a function a date and an offset like 90 days.  What would I need to do to have the function compute a new date for me based on the information received.

 

Thanks,

Fred




Answer this question

Computing a Date

  • Claudia K

    Hi fred,

    Imports Microsoft.VisualBasic.DateAndTime

    Dim fDT As  DateTime = adddays(6.2)

    Private function AddDays( byval days as double) as datetime

    Dim nDT As DateTime = Now

    AddDays = ndt.AddDays(days)

    end function

    I just did this to give you a quick idea. It would make a neat propery too. The DateTime Class is very powerful and comprehensive.

    Have a good day!

     

     



  • Computing a Date