Q:

Write a PHP script to increment date by one month

0

Write a PHP script to increment date by one month.

Sample date : 2012-12-21

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$dt = strtotime("2012-12-21");
echo date("Y-m-d", strtotime("+1 month", $dt))."\n";
?>

Sample Output:

2013-01-21

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now