I want to convert the time_read_epoch value into a readable timeformat, but I can´t get it to work during the table output. The value is saved as a bigint inside the MariaDB database. Maybe someone can help me along here.
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<table><tr> <th>Zeitstempel</th>
<th>Messwert</th>
<th>Postleitzahl</th>
<th>Ort</th>
<th>Beschreibung Messeinheit</th>
<th>Messeinheit</th>
</tr>";
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["time_read_epoch"].
"</td><td>".$row["value"].
"</td><td>".$row["plz"].
"</td><td>".$row["location"].
"</td><td>".$row["unit_name"].
" ".$row["unit"]."</td></tr>";
}
echo "</table>";
} else {
echo "0 results";
}
$conn->close()