CalendarGetStartDateFromFinishAndDuration Method (DateTime, Duration)

Returns StartDate based on specified FinishDate and Duration.

Namespace:  Aspose.Tasks
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.5
Syntax
public DateTime GetStartDateFromFinishAndDuration(
	DateTime finish,
	Duration duration
)

Parameters

finish
Type: SystemDateTime
The specified finish date.
duration
Type: Aspose.TasksDuration
The specified work duration.

Return Value

Type: DateTime
Calculated StartDate.
Examples
Shows how to get a start date by finish date and duration.
var project = new Project(DataDir + "Project1.mpp");

var calendar = project.Calendars.GetByUid(1);

// get start date by finish date and a duration
var startDate = calendar.GetStartDateFromFinishAndDuration(new DateTime(2020, 4, 10, 9, 0, 0), project.GetDuration(16, TimeUnitType.Hour));

// 8 April 2020 9:00 AM will be printed
Console.WriteLine(startDate);
See Also