Hey guys i show in my page in a table the date of birth from 209 employers.
So i have the next code:
<table id="tabla1" style="border: 1px #000000 solid;" width="%100" cellspacing="2" cellpadding="2" align="center">
<tbody>
<tr>
<td class="tdcolor" align="left"><b>Data_naixement</b></td>
</tr>
<?php
if($rows){
while($post = mysqli_fetch_assoc($result)) {
<tr >
<td style="font-family: arial;padding-left: 20px;"><?php echo $post["Data_Naixement"]; ?></td>
</tr>
}
}else{
echo "not found";
}
?>
</tbody>
</table>
My code show the date in format YYYY/mm/dd but i want in dd/mm/YYYY How can i do this format?
So i was testing the next code but doestn work good because print only the same date for all employers.
echo $post ["Data_Naixement"] =$tiempo;
$date = new DateTime($tiempo);
<td style="font-family: arial;padding-left: 20px;"><?php echo $date->format('d-m-Y'); ?></td>