DateTime::modify
PHP 5 >= 5.2.0, PHP 7, PHP 8
DateTime::modify - Alters the timestamp
Manual
DateTime::modify(
string$modifier ): public DateTime|false
Procedural style
DateTimefalsedate_modify DateTimeobject stringmodifierParameters
- object
Procedural style only: A DateTime object returned by date_create. The function modifies this object.
- modifier
-
A date/time string. Valid formats are explained in Date and Time Formats.
Return Values
Returns the DateTime object for method chaining or false on failure.