Answers for "add years to date in php"

PHP
1

add a year php

$end = date('Y-m-d', strtotime('+5 years'));
Posted by: Guest on June-24-2020
0

adding days in datetime php

<?php
$date = new DateTime('2016-06-06'); // Y-m-d
$date->add(new DateInterval('P30D'));
echo $date->format('Y-m-d') . "\n";
?>
Posted by: Guest on October-06-2021

Browse Popular Code Answers by Language