DateTime::setDate

PHP 5 >= 5.2.0, PHP 7, PHP 8
DateTime::setDate - Sets the date
Manual
Code Examples

Example #1 Values exceeding ranges are added to their parent values

Result: 2001-02-28 2001-03-01 2002-02-03
PHP Version:

Example #2 DateTime::setDate example

Result: 2001-02-03
PHP Version:


Function DateTime::setDate:

Date and Time Functions

Most used PHP functions