I am trying to calculate the difference between two dates with the format Y-m-d H:i:s
for example 2017-04-10 22:39:09
par that shows me the difference of days, hours and minutes. One of the dates will be the one in the BDD and the other the current one what I have at the moment is this:
//Hago la consulta etc... y esta es la variable donde almacenaré la fecha
$fec_ = transcurridoPublicacion($fila['Prod_Fec']);
The function that calculates it:
function transcurridoPublicacion($fecha){
$fecha2 = date("Y-m-d H:i:s");
$fechaF = date_diff($fecha, $fecha2);
return $fechaF;
}