This topic is locked

Adding one month to date

2/6/2008 7:16:05 PM
PHPRunner General questions
J
jamesberry12 author

I have a table called clients.

In that table I have a field called Dischargewhich is a date field and another called 30_day

I need the 30_day field to equal the Dischargedate plus 1 month

The Dischargedate will not be now()

Suggestions?

D
dphipson 2/8/2008

Hi,
In PHP you can do this.....
$newdate=date("Y-m-d", strtotime($olddate)+606024*30);
newdate would need to be assigned to your 30_day field and olddate would be your Discharge field. The format "Y-m-d" would have to be changed to match the format that olddate is in.
Hope that helps.
Darren