subMonths.php
Table of Contents
Functions
- subMonths() : DateTimeImmutable
- Returns a copy of a date shifted backwards by a number of months, clamping day overflow.
Functions
subMonths()
Returns a copy of a date shifted backwards by a number of months, clamping day overflow.
subMonths(DateTimeInterface $date, int $months) : DateTimeImmutable
A new DateTimeImmutable is returned ; the source date is never modified. Equivalent
to addMonths( $date , -$months ) — see addMonths() for the day-clamping semantics.
Parameters
- $date : DateTimeInterface
-
The source date.
- $months : int
-
The number of months to subtract.
Tags
Return values
DateTimeImmutable —A new immutable date shifted backwards by $months months, day-clamped.