DateTime::sub
PHP 5 >= 5.3.0, PHP 7, PHP 8
DateTime::sub - Subtracts an amount of days, months, years, hours, minutes and seconds from
a DateTime object
Manual
DateTime::sub(
DateInterval$interval ): public DateTime
Procedural style
DateTimedate_sub DateTimeobject DateIntervalintervalParameters
- object
Procedural style only: A DateTime object returned by date_create. The function modifies this object.
- interval
-
A DateInterval object
Return Values
Returns the DateTime object for method chaining or false on failure.