the following program shows that strtotime("now") doesn't give out the second of yyyy-mm-dd hh:mm:ss format.
Result:PHP Code:<?
$strstart = strtotime("2008-08-11 01:21:41");
$strend = strtotime("2008-08-11 02:03:41");//please change the time to current time
$now = strtotime("now");
echo '$strstart: '.$strstart."<br/>";
echo '$strend: '.$strend."<br/>";
echo '$now: '.$now."<br/>";
echo '$strend-$strstart: ';echo $strend-$strstart."<br/>";
echo '$strstart-$strend: ';echo $strstart-$strend."<br/>";
echo '$strstart-$now: ';echo $strstart-$now."<br/>";
echo '$now-$strstart: ';echo $now-$strstart."<br/>";
echo "end-start minute:";echo ($strend-$strstart)/60;
echo "<br/>now-start minute:";echo ($now-$strstart)/60;
?>
$strstart: 1218417701
$strend: 1218420221
$now: 1218391429
$strend-$strstart: 2520
$strstart-$strend: -2520
$strstart-$now: 26272
$now-$strstart: -26272
end-start minute:42
now-start minute:-437.866666667
my expected result is want to see $strend-$strstart: 2520 and 42 minute.
![]()




Reply With Quote