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); ?>
<?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); ?>
0 comments:
Post a Comment