Anzeige eines Unix Timestamps als Datum
Hallo,
ich habe einen Tabellenview auf der Datenbank erzeugt und zeige die Daten mit dem Contao Modul Auflistung an. Dabei wird das leicht abgewandelte Standardtemplate verwendet:
PHP-Code:
<div class="<?= $this->class ?> ce_table listing block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<?php if ($this->headline): ?>
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
<?php endif; ?>
<?php if ($this->searchable): ?>
<div class="list_search">
<form method="get">
<div class="formbody">
<input type="hidden" name="order_by" value="<?= $this->order_by ?>">
<input type="hidden" name="sort" value="<?= $this->sort ?>">
<input type="hidden" name="per_page" value="<?= $this->per_page ?>">
<div class="widget widget-select">
<label for="ctrl_search" class="invisible"><?= $this->fields_label ?></label>
<select name="search" id="ctrl_search" class="select">
<?= $this->search_fields ?>
</select>
</div>
<div class="widget widget-text">
<label for="ctrl_for" class="invisible"><?= $this->keywords_label ?></label>
<input type="text" name="for" id="ctrl_for" class="text" value="<?= $this->for ?>">
</div>
<div class="widget widget-submit">
<button type="submit" class="submit"><?= $this->search_label ?></button>
</div>
</div>
</form>
</div>
<?php endif; ?>
<?php if ($this->per_page): ?>
<div class="list_per_page">
<form method="get">
<div class="formbody">
<input type="hidden" name="order_by" value="<?= $this->order_by ?>">
<input type="hidden" name="sort" value="<?= $this->sort ?>">
<input type="hidden" name="search" value="<?= $this->search ?>">
<input type="hidden" name="for" value="<?= $this->for ?>">
<div class="widget widget-select">
<label for="ctrl_per_page" class="invisible"><?= $this->per_page_label ?></label>
<select name="per_page" id="ctrl_per_page" class="select">
<option value="10"<?php if (10 == $this->per_page): ?> selected<?php endif; ?>>10</option>
<option value="20"<?php if (20 == $this->per_page): ?> selected<?php endif; ?>>20</option>
<option value="30"<?php if (30 == $this->per_page): ?> selected<?php endif; ?>>30</option>
<option value="50"<?php if (50 == $this->per_page): ?> selected<?php endif; ?>>50</option>
<option value="100"<?php if (100 == $this->per_page): ?> selected<?php endif; ?>>100</option>
<option value="250"<?php if (250 == $this->per_page): ?> selected<?php endif; ?>>250</option>
<option value="500"<?php if (500 == $this->per_page): ?> selected<?php endif; ?>>500</option>
</select>
</div>
<div class="widget widget-submit">
<button type="submit" class="submit"><?= $this->per_page_label ?></button>
</div>
</div>
</form>
</div>
<?php endif; ?>
<?php if ($this->searchable && $this->for && empty($this->tbody)): ?>
<?= $this->no_results ?>
<?php else: ?>
<table class="all_records">
<thead>
<tr>
<td><h4>ID</h4></td>
<td> <h4>Veranstaltung</h4></td>
<td><h4>Klasse</h4></td>
<td><h4>Name Hund</h4></td>
<td><h4>Wurftag</h4></td>
<td> </td>
</tr>
</thead>
<tbody>
<?php foreach ($this->tbody as $class => $row): ?>
<tr class="<?= $class ?>">
<?php foreach ($row as $col): ?>
<td class="body <?= $col['class'] ?>"><?= $col['content'] ?></td>
<?php endforeach; ?>
<?php if ($this->details && isset($col)): ?>
<?php if ($col['details']): ?>
<td class="body <?= $this->col_last ?> col_last"><a href="<?= $col['url'] ?>"><?= Contao\Image::getHtml('assets/contao/images/info.svg') ?></a></td>
<?php else: ?>
<td class="body <?= $this->col_last ?> col_last"> </td>
<?php endif; ?>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?= $this->pagination ?>
</div>
Das Ergebnis seht Ihr hier: https://cms4.rttonline.de/Portal/testliste-2.html
Jetzt möchte ich, dass die Spalte Wurftag als Datum dd.MM.jjjj angezeigt wird. Der angezeigte Wert ist ein Unix Timestamp. Wie kann ich das erzeugen?