DateInterval::createFromDateString
PHP 5 >= 5.3.0, PHP 7, PHP 8
DateInterval::createFromDateString - Sets up a DateInterval from the relative parts of the string
Manual
DateInterval::createFromDateString(
string$datetime ): public static DateInterval|false
Uses the normal date parsers and sets up a DateInterval from the relative parts of the parsed string.
Parameters
- datetime
-
A date with relative parts. Specifically, the relative formats supported by the parser used for strtotime and DateTime will be used to construct the DateInterval.
Return Values
Returns a new DateInterval instance on success, or false on failure.