fareedreg Posted January 13, 2010 Share Posted January 13, 2010 $issdate="10/12/2009" how to increase date 15 days ahead.? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/188295-increase-date/ Share on other sites More sharing options...
MatthewJ Posted January 13, 2010 Share Posted January 13, 2010 $issdate="10/12/2009"; $newiss=date('m/d/Y', strtotime($issdate) + 60 * 60 * 24 * 15); Quote Link to comment https://forums.phpfreaks.com/topic/188295-increase-date/#findComment-994049 Share on other sites More sharing options...
fareedreg Posted January 13, 2010 Author Share Posted January 13, 2010 NOT WORKING $issdate="10/12/2009"; $newiss=date('m/d/Y', strtotime($issdate) + 60 * 60 * 24 * 15); Quote Link to comment https://forums.phpfreaks.com/topic/188295-increase-date/#findComment-994052 Share on other sites More sharing options...
oni-kun Posted January 13, 2010 Share Posted January 13, 2010 NOT WORKING $issdate="10/12/2009"; $newiss=date('m/d/Y', strtotime($issdate) + 60 * 60 * 24 * 15); Are you putting it within <?php tags? I run the very same code and I get this: '10/27/2009' $issdate="10/12/2009"; $newiss=date('m/d/Y', strtotime($issdate) + 60 * 60 * 24 * 15); echo $newiss; Quote Link to comment https://forums.phpfreaks.com/topic/188295-increase-date/#findComment-994057 Share on other sites More sharing options...
fareedreg Posted January 13, 2010 Author Share Posted January 13, 2010 I am using dd/mm/yyyy format. NOT WORKING $issdate="10/12/2009"; $newiss=date('m/d/Y', strtotime($issdate) + 60 * 60 * 24 * 15); Are you putting it within <?php tags? I run the very same code and I get this: '10/27/2009' $issdate="10/12/2009"; $newiss=date('m/d/Y', strtotime($issdate) + 60 * 60 * 24 * 15); echo $newiss; Quote Link to comment https://forums.phpfreaks.com/topic/188295-increase-date/#findComment-994059 Share on other sites More sharing options...
oni-kun Posted January 13, 2010 Share Posted January 13, 2010 I am using dd/mm/yyyy format. Then use date('d/m/Y') in place, in that code. $issdate="10/12/2009"; $newiss=date('d/m/Y', strtotime($issdate) + 60 * 60 * 24 * 15); echo $newiss; Quote Link to comment https://forums.phpfreaks.com/topic/188295-increase-date/#findComment-994060 Share on other sites More sharing options...
fareedreg Posted January 13, 2010 Author Share Posted January 13, 2010 not working see attachment [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/188295-increase-date/#findComment-994061 Share on other sites More sharing options...
fareedreg Posted January 13, 2010 Author Share Posted January 13, 2010 get done thanks for all.. thanks for your support <?php if (isset($_GET['txtissue'])) $issdate=($_GET['txtissue']); $dd=substr($issdate,0,2); $mm=substr($issdate,3,2); $yy=substr($issdate,6,4); $issdate = ("$mm/"."$dd/"."$yy"); include('connect.php'); $Tb = "param"; mysql_select_db($Db, $link); $query = "select noofdays from $Tb"; $result= mysql_query($query,$link) or die("Could not able to connect with param"); $fel=mysql_num_fields($result); $nro=mysql_num_rows($result); if($nro>0) { $row=mysql_fetch_array($result); $days=$row['noofdays']; } $newiss=date('m/d/Y', strtotime($issdate) + 60 * 60 * 24 * $days); $dd=substr($newiss,0,2); $mm=substr($newiss,3,2); $yy=substr($newiss,6,4); $issdate = ("$mm/"."$dd/"."$yy"); $_GET['txtissue']=""; $_GET['txtissue']=$issdate; echo ($_GET['txtissue']); mysql_close($link); ?> Quote Link to comment https://forums.phpfreaks.com/topic/188295-increase-date/#findComment-994064 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.