$date->toString()
Returns the date, time or datetime in YYYY-MM-DD hh:mm:ss format with optional timezone
$date->toString('date'|'time'|'datetime' $mode = 'datetime', bool $timezone = true): non-empty-string
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| $mode | 'date'or'time'or'datetime' |
'datetime'
|
|
| $timezone | bool |
true
|
Whether the timezone is printed as well |
Return type
non-empty-string
Exceptions
| Type | Description |
|---|---|
Kirby\Exception\InvalidArgumentException |
If the mode is invalid |