Jump to content

increase date


fareedreg

Recommended Posts

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;

Link to comment
https://forums.phpfreaks.com/topic/188295-increase-date/#findComment-994057
Share on other sites

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;

Link to comment
https://forums.phpfreaks.com/topic/188295-increase-date/#findComment-994059
Share on other sites

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);

 

?>

 

Link to comment
https://forums.phpfreaks.com/topic/188295-increase-date/#findComment-994064
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.