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 |
null |
$timezone | DateTimeZone |null |
null |
Return type
Kirby\Toolkit\Date
|null