Answers for "Add month to date"

PHP
0

Add month to date

<?php
$date = new DateTime('2000-12-31');

$date->modify('+1 month');
echo $date->format('Y-m-d') . "\n";

$date->modify('+1 month');
echo $date->format('Y-m-d') . "\n";
?>
Posted by: Guest on April-26-2021

Browse Popular Code Answers by Language