Skip to content

Kirby 3.9.8

Date::optional()

Tries to create an instance from the given string or fails silently by returning null on error

Date::optional(?string $datetime = null, ?DateTimeZone $timezone = null): Kirby\Toolkit\Date|null

Parameters

Name Type Default
$datetime string|null null
$timezone DateTimeZone|null null

Return type

Kirby\Toolkit\Date|null

Parent class

Kirby\Toolkit\Date