help with date manipulation

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

nickysworld
New php-forum User
New php-forum User
Posts: 1
Joined: Wed Sep 26, 2012 1:05 pm

help with date manipulation

Postby nickysworld » Wed Sep 26, 2012 1:24 pm

hi,

i want to add customer mortgage terms to their close dates in order to determine their maturity date

the mortgage term is retrieved from the database as 'cf_555' in 'Y-m-d' format along with 'closingdate' in string formats ranging from '6 months' to '60 months'

Code: Select all

$term = "SELECT vtiger_potentialscf.potentialid, vtiger_potentialscf.cf_555 FROM vtiger_potentialscf WHERE vtiger_potentialscf.cf_555 <>'' LIMIT 0, 10";
$terms = mysql_query($term);
while($trow=mysql_fetch_array($terms)) { $cf_555=mktime(0,0,0,str_replace(' months','',$trow["cf_555"]));
$potentialid=$trow["potentialid"];

$close = "SELECT vtiger_potential.closingdate FROM vtiger_potential
WHERE vtiger_potential.potentialid = '$potentialid'";
$closedate = mysql_query($close);
while($crow=mysql_fetch_array($closedate)) { $closingdate=strtotime($crow["closingdate"]);

echo date('Y-m-d',$closingdate)."+".date('Y-m-d',$cf_555)."=".date('Y-m-d',$closingdate+$cf_555)."<br>";
   }}


thanks in advance for your help

Return to “PHP coding => General”

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron