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
 3$task = $project->getRootTask()->getChildren()->add("Task");
 4
 5$tsk = new Tsk();
 6
 7$duration = $task->get($tsk->DURATION);
 8
 9print "Duration in Days: " . $duration->toString();
10
11$timeUnitType = new TimeUnitType();
12
13$duration = $duration->convert($timeUnitType->Hour);
14
15print "Duration in Hours: ". (string)$duration;
16
17$task->set($tsk->DURATION, $task->get($tsk->DURATION)->subtract(0.5));
18
19print "\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.