time()获得当前的时间 , 加上24*60*60*7,得出七天后的时间戳,再转化为当ymd his格式喽

解决方案 »

  1.   

    date()为今天,下面是今天的7天后!
    dateadd("d",7,date())
    date如果为某一变量则
    dateadd("d",7,date)则就变量后的7天
      

  2.   

    echo date(" Y m d  H:i:s ",strtotime("+7 day"));
      

  3.   

    echo date(" Y m d  H:i:s ",time()+24*60*60*7);
      

  4.   

    function linow($tt)//数据库存储的TIME()格式时间离现在时间有多久
    { $dlt=((time()-$tt)/60);

    {if ($dlt>=0 and $dlt<60)
    $t=((int)$dlt)."分钟";
    if ($dlt>=60 and $dlt<(60*24))
    $t=(((int)($dlt/60)))."小时";
    if  ($dlt>=(60*24) and $dlt<(60*24*30))
    $t=((int)($dlt/(60*24)))."天";
    if ($dlt>=(60*24*30) and $dlt<(60*24*30*12))
    $t=((int)($dlt/(60*24*30)))."月";
    if ($dlt>=(60*24*30*12)) 
    $t=((int)($dlt/(60*24*30*12)))."年";
    }
    echo $t,"前";}