0

I know it's a dumb question, but I can't figure it out.
What's wrong with this code? -

$progress_report = curdate();

It doesn't work.

Thank you!

4
Contributors
7
Replies
10
Views
7 Years
Discussion Span
Last Post by anushathecoder
0

Now, this

$progress_report = date("Y-m-d");

works, but when I try to do some date math - like add a month to the current date, it doesn't. I tried these:

$progress_report = strtotime(date("Y-m-d", strtotime($progress_report)) . " +1 month");
$progress_report = mktime(0, 0, 0, date("m")+1, date("d"), date("Y"));
$progress_report= strtotime("+1 month");

All failed.

0

$time = strtotime("2010-12-11");
$final = date("Y-m-d", strtotime("+1 month", $time)); // to increment 1 month

0

$time = strtotime("2010-12-11");
$final = date("Y-m-d", strtotime("+1 month", $time));// increment to 1 month

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.