I need help with the code. I building a housekeeping for moderation in a game. And in the game you could be banned. No problems there but when I want to write the bans expire time in housekeeping the mysql structure for just expire time is writen in DOUBLE (unix time). How do I convert it in the housekeeping so you could read the timeformat normal?
Maybe this question is asked before but I need help with the code, cause Im not a pro coder haha. How should I write the code?
I have like this:
$getBans = mysql_query("SELECT * FROM `bans`");
$page_number = $_GET['page_number'];
if(!isset($_GET['page_number']) || !is_numeric($_GET['page_number']))
{
$page_number = 1;
}
$pages = mysql_num_rows($getBans);
$per_page = "15";
$last_page = ceil($pages/$per_page);
if ($page_number < 1)
{
$page_number = 1;
}
else if($page_number > $last_page)
{
$page_number = $last_page;
}
$max = 'LIMIT ' .($page_number - 1) * $per_page .',' .$per_page;
$data_p = mysql_query("SELECT * FROM `bans` ORDER BY `id` DESC $max ");
$next_page = $page_number+1;
$previous_page = $page_number-1;
echo "
<div class='center80'>
<table class='zebra-striped'>
<thead>
<tr>
<th>Ban ID</th>
<th>Type</th>
<th>Value</th>
<th>Reason</th>
<th>Banned By</th>
<th>Expires</th>
<th>More Information</th>
</tr>
</thead>
<tbody>";
if(mysql_num_rows($getBans) == 0)
{
echo("<tr><td>There are no bans to display</td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>");
}
else
{
while($ban = mysql_fetch_array($data_p))
{
$banid = $ban['id'];
$bantype = $ban['bantype'];
$banvalue = $ban['value'];
$banreason = $ban['reason'];
$banexpire = $ban['expire'];
$banaddedby = $ban['added_by'];
$banaddedon = $ban['added_date'];
$banappeal = $ban['appeal_state'];
$banuserid = $users->user_Data($banvalue,"id");
echo("<tr><td>".$banid."</td><td>".$bantype."</td><td>".$banvalue."</td><td>".$banreason."</td><td>".$banexpire."</td><td>".$banaddedby."</td><td>");
And the time in housekeeping now shows this under "Expires": 1532908334.8502.
What should I write in the code to convert it to normal date and time?
Thanks