endOfWeek.php
Table of Contents
Functions
- endOfWeek() : DateTimeImmutable
- Returns the last representable instant of the week containing a date.
Functions
endOfWeek()
Returns the last representable instant of the week containing a date.
endOfWeek(DateTimeInterface $date[, int $firstDayOfWeek = 1 ]) : DateTimeImmutable
A new DateTimeImmutable is returned, set to 23:59:59.999999 (microseconds
included) on the last day of the week ; the source date is never modified. The
timezone of the returned value is the one carried by $date.
$firstDayOfWeek follows the same ISO-8601 numbering as startOfWeek() — see there
for details. The last day of the week is $firstDayOfWeek + 6 (mod 7).
Parameters
- $date : DateTimeInterface
-
The source date.
- $firstDayOfWeek : int = 1
-
The first day of the week,
1(Monday) to7(Sunday). Default1.
Tags
Return values
DateTimeImmutable —A new immutable date, at the end of the week containing $date.