开发者

Get time from database and compare

I want to开发者_JS百科 get time from database then use it to compare with current time. How can i do it?

$timeStart = $row['timeStart'];
echo 'Time Start : '.$timeStart;
echo "</br>";
$time_offset =ICT; // Change this to your time zone
$time_a = ($time_offset * 120);
$time = date("M-d-Y H:i:s",time() + $time_a);
echo 'Current time is : '.$time;
echo "</br>";
if ($timeStart + $timeForEachDownload > $time) $totalDownload = $totalDownload + 1;


Change this:

if ($timeStart + $timeForEachDownload > $time)
     $totalDownload = $totalDownload + 1;

To this:

if ((strtotime($timeStart) + strtotime($timeForEachDownload)) > $time)
     $totalDownload = $totalDownload + 1;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜