date() table()
A date column: a timestamp or a date string formatted with _format_date().
table()->date($name, $desc = '', $extra = [])Options
| Option | Meaning |
|---|---|
format | short (default), long, full, or a strftime-like pattern (%y-%m-%d %H:%M). |
(common options) | The common column options, badge / label. |
Example
| Name | Added | Added (custom format) |
|---|---|---|
| Order 1001 | 11/02/26 | 26-11-02 09:15 |
| Order 1002 | 10/26/26 | 26-10-26 09:33 |
Code
$rows = [
1 => ['id' => 1, 'name' => 'Order 1001', 'add_date' => '2026-11-02 09:15:00'],
2 => ['id' => 2, 'name' => 'Order 1002', 'add_date' => 1793000000],
];
return table($rows, ['no_pages' => 1])
->text('name')
->date('add_date', 'Added')
->date('add_date', ['desc' => 'Added (custom format)', 'format' => '%y-%m-%d %H:%M']);Notes
- Numbers are Unix timestamps, strings are read by
strtotime(); the cell does not wrap.
See also: form/info, demo:table/form