formatted time and +2 hours

This commit is contained in:
Lanta 2023-11-16 16:25:16 +01:00
parent 42bef1c8bb
commit 7583831f21

View file

@ -66,11 +66,13 @@ $lastMatches = array_slice($allMatches, 0, 8);
foreach ($lastMatches as $match) { foreach ($lastMatches as $match) {
$matchid = $match['id']; $matchid = $match['id'];
$date = new DateTime($match['createdAt']);
$date->modify('+2 hours');
$formattedDate = $date->format('m-d H:i:s');
echo "<tr> echo "<tr>
<td><a href='matchinfo.php?matchid=$matchid'>" . $match['playername'] . "</a></td> <td><a href='matchinfo.php?matchid=$matchid'>" . $match['playername'] . "</a></td>
<td><a href='matchinfo.php?matchid=$matchid'>" . $match['createdAt'] . "</a></td> <td><a href='matchinfo.php?matchid=$matchid'>" . $formattedDate . "</a></td>
<td><a href='matchinfo.php?matchid=$matchid'>" . $match['gameMode'] . "</a></td> <td><a href='matchinfo.php?matchid=$matchid'>" . $match['gameMode'] . "</a></td>
<td><a href='matchinfo.php?matchid=$matchid'>" . $match['matchType'] . "</a></td> <td><a href='matchinfo.php?matchid=$matchid'>" . $match['matchType'] . "</a></td>
<td><a href='matchinfo.php?matchid=$matchid'>" . (isset($mapNames[$match['mapName']]) ? $mapNames[$match['mapName']] : $match['mapName']) . "</a></td> <td><a href='matchinfo.php?matchid=$matchid'>" . (isset($mapNames[$match['mapName']]) ? $mapNames[$match['mapName']] : $match['mapName']) . "</a></td>