DateDifference Method

Returns the duration between two dates in minutes.

Syntax

expression**.DateDifference(StartDate, FinishDate, Calendar)**

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

StartDate    Required Variant. The date used as the beginning of the duration.

FinishDate    Required Variant. The date used as the end of the duration.

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

Example

The following example displays the duration of a task that begins on 7/11/97 at 8 A.M. and ends on 7/13/97 at 5:00 P.M.

Sub FindDuration()
    MsgBox Application.DateDifference ("7/11/97 8:00 AM", "7/13/97 5:00 PM")
End Sub

Applies to | Application Object

See Also | DateAdd Method | DateFormat Method | DateSubtract Method