Rss Feed
  1. Php date difference!!

    Thursday, 8 November 2012

    Php date difference between sql date and current date:

    <?php $curtime = date("Y-m-d H:i:s"); // Mysql date format
          $endtime = $sd['denddate'];
         $ts1 = strtotime($curtime);
        $ts2 = strtotime($endtime);
         $diff = ($ts2 - $ts1)/3600/24;
        echo round($diff);  ?>

  2. 0 comments:

    Post a Comment