PHP时间差

 $uesrid=$_GET['userid']; 
 $root_level=$_GET['root_level']+1;
 if($root_level!="")
 {
 $times=" +".($root_level*30)." second";
 $time1=strtotime(date("Y-m-d H:i:s",time()).$times);//year,month,day,hour,minute,second,相隔多少时间就加几
 //$retrun=mysql_query("update users set root_time=now() where id=".$uesrid,$conn);
 } 
  echo date('Y-m-d H:i:s',$time1);

原文地址:https://www.cnblogs.com/yangxiao/p/1332122.html