Page 1 of 1

Date calculation

Posted: Wed Jul 02, 2008 11:15 pm
by sampada
Hi
I need to calculate next payment date based on start payment date and mode of pament (i.e yearly, quarterly, half-yearly and monthly)

If the start payment is 2008-07-08 (Y-m-d) and mode of payment is half yearly than the next payment date would be 2009-01-08 .
For the next time, the next payment date would be start payment date and we need to calculate next payment date.

Same with other modes of payment(quarterly, yearly and monthly)

Is there any inbuilt function in Php for this? or may be is there any efficient way to perform this action

Any suggestions
Thanks
sampada

Re: Date calculation

Posted: Wed Jul 02, 2008 11:46 pm
by John Cartwright
Heres a start,

Code: Select all

echo strtotime('2008-07-08', '+6 months');

Re: Date calculation

Posted: Thu Jul 03, 2008 5:11 am
by sureshmaharana
Hi,

You can use this for half yearly:
$date = date('Y-m-d', strtotime("+6 Month"));

Regards,
Suresh Maharana