I made a system that saves the date in Y-m-d
format, both the entry and the exit date. What I did to give back that format is take the date in a variable and use strtotime
, like this:
<?php
$originalDates = $row['ingreso'];
$originalDates. = $row['salida'];
$salida = date("d-m-Y", strtotime($originalDates));
?>
Ingreso el dia <b><?=$salida;?></b>
Finaliza el dia <b><?=$salida;?></b>
But error comes when I concatenate the variable to change the exit date and when I do this it does not give me any error, but nothing appears on the page.