Managing Task Durations in PHP

Aspose.Tasks - Managing Durations

To manage durations using Aspose.Tasks Java for PHP, simply invoke ManagingDuration module. Here you can see example code.

PHP Code

 1$project = new Project();
 2$task = $project->getRootTask()->getChildren()->add("Task");
 3$tsk = new Tsk();
 4$duration = $task->get($tsk->DURATION);
 5print "Duration in Days: " . $duration->toString();
 6$timeUnitType = new TimeUnitType();
 7$duration = $duration->convert($timeUnitType->Hour);
 8print "Duration in Hours: ". (string)$duration;
 9$task->set($tsk->DURATION, $task->get($tsk->DURATION)->subtract(0.5));
10print "\n0.5 weeks: " . (string)$task->get($tsk->DURATION);

Download Running Code

Download Managing Durations (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.