This is a table, it has a field named register_date
which is automatically added by DB as a TimeStamp.
I want to show this field as a Persian DateTime. like this image below:
and here is my php piece of code:
<?php
$q = "SELECT * from `tbl_registers2`";
$result = $db->query($q);
$row = 1;
while ($fields = $result->fetch_assoc()) {
?>
<tr data-id="<?= $fields['id']; ?>">
<td><?= $row++; ?></td>
<td><?= $fields['first_name']; ?></td>
<td><?= $fields['last_name']; ?></td>
<td><?= $fields['mobile']; ?></td>
<td><?= $fields['email']; ?></td>
<td><?= $fields['register_date']; ?></td>
<td><img class="delete" src="../assets/img/trash.png"></td>
<td>
<a href="edit.php?id=<?= $fields['id']; ?>">edit</a>
</td>
</tr>
<?php
}
?>
how to do this?