Adding or Subtracting Time

PHP
$dateTime = new DateTime('2016-01-01');
$dateTime->modify('+1 day');
echo $dateTime->format('Y-m-d H:i:s');`
# Output: 2016-01-02 00:00:00

# You can as well use the constructor if you work on the current date:



$dateTime = new DateTime('+1d');
echo $dateTime->format('Y-m-d H:i:s');`
# Output the current date plus one day.
Source

Also in PHP: