|
DateTimeImmutable::setDateSets the date Description
#[\NoDiscard]
public DateTimeImmutable DateTimeImmutable::setDate(int
$year, int $month, int $day)Returns a new DateTimeImmutable object with the current date of the DateTimeImmutable object set to the given date. Parameters
Return ValuesReturns a new DateTimeImmutable object with the modified data. ExamplesExample #1 DateTimeImmutable::setDate example Object-oriented style The above examples will output: 2001-02-03 Example #2 Values exceeding ranges are added to their parent values The above example will output: 2001-02-28 2001-03-01 2002-02-03 See Also
|