DateTime::sub

DateTime::sub

date_sub

(PHP 5 >= 5.3.0, PHP 7)

DateTime::sub -- date_sub Subtracts an amount of days, months, years, hours, minutes and seconds from a DateTime object

Description

Object oriented style

public DateTime DateTime::sub ( DateInterval $interval )

Procedural style

DateTime date_sub ( DateTime $object , DateInterval $interval )

Subtracts the specified DateInterval object from