im using PHP
I don't know if this is possible but i have a start date and and end date, im wanting to get the percentage of completed time from these two dates.
so if it will need to take the start end and current time and date and fire back
35% Completed etc..
Nov 02nd 2015 14:05:15 Nov 02nd 2015 18:05:15
Thanks any tips or guide is a big help.
I have been trying to use this but its not working.
<?php
$startDate = date_create('$start');
$endDate = date_create('$end');
$currentDate = date_create('$date');
$totalTime = date_diff($endDate, $startDate);
$elapsedTime = date_diff($currentDate, $startDate);
$totalTimeDays = $totalTime->format("%d");
$elapsedTimeDays = $elapsedTime->format("%d");
echo "Total project time = " . $totalTimeDays . "<br/>";
echo "Elapsed project time = " . $elapsedTimeDays . "<br/>";
echo "Percent of project complete = " . ($elapsedTimeDays / $totalTimeDays) * 100.0;
?>