Hi
try this
$nextweek = time()+(7*24*60*60);
echo 'Next week'.date('d-m-Y',$nextweek)."\n";
$nextmonth = time()+(30*24*60*60);
echo 'Next month'.date('d-m-Y',$nextmonth)."\n";
Regards
savanm: enclose your code with code or php tags!! - moderator
That is not going to work! Think about current date like 1 Jan, 31 Jan, etc.
Instead use the standard PHP strtotime function and format the result. Like this:
[php]<?php
echo "1 week from now = " . date("Y-m-d", strtotime("+1 week"));
echo '<br />';
echo "1 month from now = " . date("Y-m-d", strtotime("+ 1 month"));
?>[/php]
For more information on how to use the strtotime command, see
strtorime function in the standard PHP manual.
Ronald :cool: