-1
how can I calculate a date range for example: 24/08/2017 and 09/05/2017 and take the total amount of days?
for example the result of this difference would have to give 106 days difference from one date to another
code:
$data = $row['data'];
$data_inicio = $row['data_inicio'];
$now = time();
$date1 = date("Y-m-d", $now);
$time_inicial = geraTimestamp($date1);
$time_final = geraTimestamp($data);
$diferenca = $time_final - $time_inicial;
$dias = (int)floor($diferenca / (60 * 60 * 24));
$d2 = geraTimestamp($data_inicio);
$diff = $time_inicial - $d2;
$diasC = (int)floor($diff / (60 * 60 * 24));
$conta = ($dias * 100) / $diasC;
$result = number_format($conta,2);
this sum and the total value in days as I mentioned in the example 24/08/2017 and 09/05/2017 the total value in days of those dates and 106 days. intendeu? Voce will add the first date that and 09/05/2017 with 24/08/2017 and the value that will come out and 106 days
– Leonardo Costa
how do I do what I want you would know me?
– Leonardo Costa
I’ve already edited the answer.
– Woss