how to compare dates and times with php

0

I want to buy the dates and times for example: invoices received from 8:30 a.m. to 1:30 p.m. which are "on time" if delivered until 6:00 p.m., on the same day, but are "out of time".

<?php
include('conexion.php');
$query=mysql_query("SELECT factura, fechafactura, cliente, hrasalida, hraentrega, hrallegada, chofer, vehiculo, direccion from facturacion where estatus='ENTREGA DOMICILIO' order by fechafactura DESC LIMIT 70");
$cont=mysql_num_rows($query);
if ($cont>0)
{

    while ($array=mysql_fetch_array($query))
    {

        $hrini=$array[3];
        $hrfin=$array[4];
        $diferencias = strtotime($hrfin) - strtotime($hrini);
        //$time = time();
            $mins=$diferencias/60;
        //$fin= date("i", $diferencias);    
        //$diferencias = time();

        echo'<tr><td>'.$array[0].'</td><td>'.$array[1].'</td><td>'.$array[2].'</td><td>'.$array[3].'</td><td>'.$array[4].'</td><td>'.$array[5].'</td><td>'.$array[6].'</td><td>'.$array[7].'</td><td>'.$array[8].'</td><td>'.$mins.' minutos'. '</td></tr>';
    }
}
else
{
    echo'<tr><td>No hay registros</td></tr>';
}
echo '<table>';
/***************************************TERMINA FACTURAS*/
?>
    
asked by jasiel 05.09.2018 в 20:20
source

0 answers