DateAdd Method

Adds a duration to a date to return a new date.

Syntax

expression**.DateAdd(StartDate, Duration, Calendar)**

*expression   *     Required. An expression that returns an Application object.

StartDate    Required Variant. The original date to which the duration is added.

Duration    Required Variant. The duration to add to the start date.

Calendar    Optional Object. A resource, task, or base calendar object. The default value is the calendar of the active project.

Example

The following example displays the finish date of a three-day task that begins on 7/11/97 at 8 A.M.

Sub FindFinishDate()
    MsgBox Application.DateAdd(StartDate:="7/11/97 8:00 AM", Duration:="3d")
End Sub

Applies to | Application Object

See Also | DateDifference Method | DateFormat Method | DateSubtract Method