Hi, I have a database field (duedate) and depending on the periodic field
I want to update that field the number of months of the periodic field.
The following code echos the desired result but:
1) I need advice for how to code:
$date = new DateTime("+(periodic) months")
2) I want to put this result into the "duedate" field.
My date fields are type "timestamp". A couple of hints?
I want to update that field the number of months of the periodic field.
The following code echos the desired result but:
1) I need advice for how to code:
$date = new DateTime("+(periodic) months")
2) I want to put this result into the "duedate" field.
My date fields are type "timestamp". A couple of hints?
PHP:
// advance duedate =+ peridotic(number of months)
$date = new DateTime("+6 months");
$date->modify("-" . ($date->format('F')+0) . " days");
echo $date->format('Y-m-d');
echo "
";
// advance duedate one month
$date = new DateTime("+1 months");
$date->modify("-" . ($date->format('F')+0) . " days");
echo $date->format('Y-m-d');