I am creating an arrangement to fill a table with the query of a database, at the time of bringing the dates that are saved I format them in Spanish to pass them to the arrangement but it does not show anything.
This is the php:
<?php
$sql = "SELECT *";
$sql.=" FROM registros where estado = 'pendiente'";
$query=mysqli_query($conexion, $sql) or die("ajax-grid-data.php: get PO");
$data = array();
while( $row=mysqli_fetch_array($query) ) {
setlocale(LC_ALL,"es_ES");
$dir = $row["dir_obra"];
$time = $row["hora"];
$fecha = $row["fecha_entrega"];
$date = new DateTime($time);
$datef = new DateTime($fecha);
$hora12 = $date->format("h:i");
$newfecha = $datef->format('l jS \of F Y');
$hora= $hora12;
$fechaf = $newfecha;
$fecha_entrega = new DateTime($row["fecha_entrega"]);
//echo strftime("%c", $fecha_entrega->getTimestamp())."<br/>";
$fecha_entrega_esp = strftime("%a, %d de %B del %G", $fecha_entrega->getTimestamp())."<br/>";
//echo $fecha_entrega_esp;
$fechahr = $fechaf." ".$hora;
$dirind = $dir." ".$row["indicaciones"];
$nestedData=array();
$nestedData["id"] = $row["id"];
$nestedData["cliente"] = $row["cliente"];
$nestedData["metodo_pago"] = $row["metodo_pago"];
$nestedData["fechahr"] = strftime("%a, %d de %B del %G", $fecha_entrega->getTimestamp())."<br/>";
$nestedData["fecha_registro"] = $row["fecha_registro"];
$nestedData["dir_obra"] = $dir;
$nestedData["indicaciones"] = $row["indicaciones"];
$nestedData["resistencia"] = $row["resistencia"];
$nestedData["pu"] = $row["pu"];
$nestedData["tiro"] = $row["tiro"];
$nestedData["m3"] = $row["m3"];
$nestedData["ton"] = $row["ton"];
$nestedData["elem_colar"] = $row["elem_colar"];
$nestedData["revenimiento"] = $row["revenimiento"];
$nestedData["adicionales"] = $row["adicionales"];
$nestedData["padd"] = $row["padd"];
$nestedData["responsable"] = $row["responsable"];
$nestedData["fecha_entrega"] = strftime("%a, %d de %B del %G", $fecha_entrega->getTimestamp());
$nestedData["hora"] = $hora;
$nestedData["dirind"] = $dirind;
$data[] = $nestedData;
}
$json_data = array("data" => $data);
echo json_encode($json_data);
?>
The weirdest thing is that yesterday I implemented it for the first time and it worked but not today, also when I add any other format or date variable works perfectly.