DateTime::modify

PHP 5 >= 5.2.0, PHP 7, PHP 8
DateTime::modify - Alters the timestamp
Manual
Code Examples

Example #1 Beware when adding or subtracting months

Result: 2001-01-31 2001-03-03
PHP Version:

Example #2 DateTime::modify example

Result: 2006-12-13
PHP Version:


Function DateTime::modify:

Date and Time Functions

Most used PHP functions