Calculate Task Duration
Contents
[
Hide
Show
]Aspose.Tasks - Calculate Task Duration in Different Units
To Calculate Task Duration in Different Units using Aspose.Tasks Java for PHP, simply invoke CalculateTaskDuration module. Here you can see example code.
PHP Code
1$project = new Project('test_tasks.mpp');
2
3$tsk = new Tsk();
4
5$time_unit_type = new TimeUnitType();
6
7$task = $project->getRootTask()->getChildren()->getById(1);
8
9print (double)(string)($task->get($tsk->DURATION)->convert($time_unit_type->Minute))."\n";
10
11print (double)(string)($task->get($tsk->DURATION)->convert($time_unit_type->Day))."\n";
12
13print (double)(string)($task->get($tsk->DURATION)->convert($time_unit_type->Hour))."\n";
14
15print (double)(string)($task->get($tsk->DURATION)->convert($time_unit_type->Week))."\n";
16
17print (double)(string)($task->get($tsk->DURATION)->convert($time_unit_type->Month))."\n";
Download Running Code
Download Calculate Task Duration in Different Units (Aspose.Tasks) from any of the below mentioned social coding sites: