Date::optional()
Tries to create an instance from the given string or fails silently by returning null
on error
Parameters
Name | Type | Default |
---|---|---|
$datetime | string |
null |
$timezone | DateTimeZone |
null |
Return type
Kirby\Toolkit\Date
|null