Table of contents
TOC
Collapse the table of content
Expand the table of content

Application.DateDifference Method (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Returns the duration between two dates in minutes, for an automatically scheduled task.

Syntax

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

expression A variable that represents an Application object.

Parameters

NameRequired/OptionalData TypeDescription
StartDateRequiredVariantThe date used as the beginning of the duration.
FinishDateRequiredVariantThe date used as the end of the duration.
CalendarOptionalObjectA resource or task base calendar object. The default value is the calendar of the active project.

Return Value

Long

Remarks

To get a difference between two dates for a manually scheduled task, which uses an effective calendar that can include non-working time, use the EffectiveDateDifference property.

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
© 2018 Microsoft