Re: [PHP] Adding Time

2010-03-31 Thread Anshul Agrawal
On Sun, Mar 28, 2010 at 4:22 AM, Gary gwp...@ptd.net wrote: Perfect, thank you very much for your help! Gary Yousif Masoud yousif.mas...@gmail.com wrote in message news:x2tbffe24ad1003271548l65cb6e65qd8f35ae0636e...@mail.gmail.com... On Sat, Mar 27, 2010 at 10:26 PM, Gary gwp...@ptd.net

[PHP] Adding Time

2010-03-27 Thread Gary
I have a manual input field to add a date on a form. There is another manual input field to add number of months (This is for a loan agreement).I am trying to add the two together to get an ending date. I dont think I am close, can anyone poimt me in the right direction.

Re: [PHP] Adding Time

2010-03-27 Thread Nilesh Govindarajan
On 03/27/2010 11:13 PM, Gary wrote: I have a manual input field to add a date on a form. There is another manual input field to add number of months (This is for a loan agreement).I am trying to add the two together to get an ending date. I dont think I am close, can anyone poimt me in the

Re: [PHP] Adding Time

2010-03-27 Thread Gary
Thanks for your reply. This comes from the manual, I have tried to change to my variables. I am not getting any error messages, but I am not able to add the $loan_length to the $pay_date. Thanks again for any help. gary ?php $pay_date=($_SESSION['pay_date']);

Re: [PHP] Adding Time

2010-03-27 Thread Yousif Masoud
On Sat, Mar 27, 2010 at 8:41 PM, Gary gwp...@ptd.net wrote: [...] ?php $pay_date=($_SESSION['pay_date']); $loan_length=($_SESSION['loan_length']); $orgDate=($_SESSION['pay_date']); $mth=($_SESSION['loan_length']); function add_date($orgDate,$mth){ $cd = strtotime($orgDate);

Re: [PHP] Adding Time

2010-03-27 Thread Gary
It is a multi page form with all information being writting to the database via the $_SESSION's. Gary Yousif Masoud yousif.mas...@gmail.com wrote in message news:k2qbffe24ad1003271414za1377a2dsb0e4a2d23d411...@mail.gmail.com... On Sat, Mar 27, 2010 at 8:41 PM, Gary gwp...@ptd.net wrote:

Re: [PHP] Adding Time

2010-03-27 Thread Yousif Masoud
On Sat, Mar 27, 2010 at 8:41 PM, Gary gwp...@ptd.net wrote: [...] ?php $pay_date=($_SESSION['pay_date']); $loan_length=($_SESSION['loan_length']); $orgDate=($_SESSION['pay_date']); $mth=($_SESSION['loan_length']); function add_date($orgDate,$mth){ $cd = strtotime($orgDate);

Re: [PHP] Adding Time

2010-03-27 Thread Gary
I have copied the echo and the code, for clarity I have echo'd 1,2,3, etc to see which is working. Thank you for your help. Hope this is clear. Gary $loan_length=($_SESSION['loan_length']); //is set to 36 months $pay_date=($_SESSION['pay_date']); //is set to 01-05-2010

Re: [PHP] Adding Time

2010-03-27 Thread Yousif Masoud
On Sat, Mar 27, 2010 at 10:26 PM, Gary gwp...@ptd.net wrote: [...] strtotime('$pay_date')); [...] If you want the value of $pay_date to be the argument of strtotime, you need to enclose it in double quotes (do the same for all other occurrences). Try: strtotime($pay_date); [...] When a

Re: [PHP] Adding Time

2010-03-27 Thread Yousif Masoud
On Sat, Mar 27, 2010 at 10:26 PM, Gary gwp...@ptd.net wrote: [...] $end_date=date('m-d-Y',strtotime('$mth')) + date('m-d-Y', strtotime('$pay_date')); [...] Try changing above to: $end_date = date('m-d-Y',strtotime($pay_date + $mth months)); I think your mail client took it out of the

Re: [PHP] Adding Time

2010-03-27 Thread Gary
Perfect, thank you very much for your help! Gary Yousif Masoud yousif.mas...@gmail.com wrote in message news:x2tbffe24ad1003271548l65cb6e65qd8f35ae0636e...@mail.gmail.com... On Sat, Mar 27, 2010 at 10:26 PM, Gary gwp...@ptd.net wrote: [...] $end_date=date('m-d-Y',strtotime('$mth')) +