Adding Time

From: Date: Sat, 27 Mar 2010 17:43:29 +0000
Subject: Adding Time
Groups: php.general 
Request: Send a blank email to php-general+get-303531@lists.php.net to get a copy of this message
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. $pay_date=($_SESSION['pay_date']); $loan_length=($_SESSION['loan_length']); $pay_date = new DateTime($_SESSION['pay_date']); $end_date = new DateTime($_SESSION['pay_date']) + ($_SESSION['loan_length']); echo $end_date->format("m-d.Y").'<br />'; date_add($pay_date + new DateInterval($_SESSION['loan_length'])); echo '<br />'.$date->format("d-m-Y"); Gary __________ Information from ESET NOD32 Antivirus, version of virus signature database 4978 (20100326) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com

« previous php.general (#303531) next »