|
DateTime::subdate_subSubtracts an amount of days, months, years, hours, minutes and seconds from a DateTime object DescriptionObject-oriented style
public DateTime DateTime::sub(DateInterval
$interval )Procedural style DateTime date_sub(DateTime
$object , DateInterval $interval )Modifies the specified DateTime object, by subtracting the specified DateInterval object. Like DateTimeImmutable::sub but works with DateTime. The procedural version takes the DateTime object as its first argument. Parameters
Return ValuesReturns the modified DateTime object for method chaining. Errors/Exceptions
Object Orientated API only: If an unsupported operation is attempted, such as using a
DateInterval object representing relative time
specifications such as Changelog
See Also
|