|
DateTimeImmutable::setISODateSets the ISO date Description
public DateTimeImmutable DateTimeImmutable::setISODate(int
$year , int $week , int $dayOfWeek = 1)Returns a new DateTimeImmutable object with the date set according to the ISO 8601 standard - using weeks and day offsets rather than specific dates. Parameters
Return ValuesReturns a new DateTimeImmutable object with the modified data. ExamplesExample #1 DateTimeImmutable::setISODate example Object-oriented style
Procedural style
The above examples will output: 2008-01-07 2008-01-13 Example #2 Values exceeding ranges are added to their parent values
The above example will output: 2008-01-13 2008-01-14 2009-01-04 Example #3 Finding the month a week is in
The above examples will output: 3 See Also
|