In my project i have to get the expiry date of a package from the 'date of purchasing' the package and the 'validity in days' of the package.I got a code from the php.net as follows
<?php
$date = new DateTime('2000-01-01');
$date->add(new DateInterval('P10D'));
echo $date->format('Y-m-d') . "\n";
?>
Now suppose the date of purchase is like 2013-01-17 and the validity in days is 180 Now if i use the php.net example as follows
<?php
$date = new DateTime('2013-01-17');
$date->add(new DateInterval('P180D'));
echo $date->format('Y-m-d') . "\n";
?>
Will i get the output as 2013-04-17? I need the output like
yyyy-mm-dd
I cant run the program in my personal computer but i have to carry on the codding of the project so i'm here.