Calculate Task Duration in Different Units in PHP

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$tsk = new Tsk();
3$time_unit_type = new TimeUnitType();
4$task = $project->getRootTask()->getChildren()->getById(1);
5print (double)(string)($task->get($tsk->DURATION)->convert($time_unit_type->Minute))."\n";
6print (double)(string)($task->get($tsk->DURATION)->convert($time_unit_type->Day))."\n";
7print (double)(string)($task->get($tsk->DURATION)->convert($time_unit_type->Hour))."\n";
8print (double)(string)($task->get($tsk->DURATION)->convert($time_unit_type->Week))."\n";
9print (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:

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.