Re: Adding Time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 28, 2010 at 4:22 AM, Gary <gwpaul@xxxxxxx> wrote:

> Perfect, thank you very much for your help!
>
> Gary
>
>
> "Yousif Masoud" <yousif.masoud@xxxxxxxxx> wrote in message
> news:x2tbffe24ad1003271548l65cb6e65qd8f35ae0636eb2b@xxxxxxxxxxxxxxxxx
> > On Sat, Mar 27, 2010 at 10:26 PM, Gary <gwpaul@xxxxxxx> 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 add_date function.
> >
> >
> >
> > __________ Information from ESET Smart Security, version of virus
> > signature database 4978 (20100326) __________
> >
> > The message was checked by ESET Smart Security.
> >
> > http://www.eset.com
> >
> >
>
>
>
> __________ Information from ESET Smart Security, version of virus signature
> database 4978 (20100326) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Be cautious while using this.

$mth = 1;
$pay_date = "2010-01-31";
$end_date = date('m-d-Y',strtotime("$pay_date + $mth months"));
echo $end_date; //03-03-2010, will take you to March

Thanks,
Anshul

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux