|
DateTimeImmutable::addReturns a new object, with added amount of days, months, years, hours, minutes and seconds Description
#[\NoDiscard]
public DateTimeImmutable DateTimeImmutable::add(DateInterval
$interval)Creates a new DateTimeImmutable object, and adds the specified DateInterval object to this, to represent the new value. Parameters
Return ValuesReturns a new DateTimeImmutable object with the modified data. ExamplesExample #1 DateTimeImmutable::add example Object-oriented style Example #2 Further DateTimeImmutable::add examples The above example will output: 2000-01-01 10:00:30 2007-06-05 04:03:02 Example #3 Beware when adding months The above example will output: 2001-01-31 2001-03-03 See Also
|