存数据库之前,用strtotime转成10位数字, 然后判断直接比就好了。

解决方案 »

  1.   

    存:
    $_POST['time1']='08:00:08';
    $_POST['time2']='16:00:08';
    $data['time1']=strtotime(in($_POST['time']));
    $data['time2']=strtotime(in($_POST['time']));
    读:
    $info['time1']=1395100808;
    $info['time2']=1395129608;
    $time1=date("H:i:s",$info['time1']);
    $time2=date("H:i:s",$info['time2']);求怎么判断当前服务器时间是否为:
    $time1
    $time2
    之间。
      

  2.   

    $current = date("H:i:s");
    if( $current >$time1 && $current < $time2){
         echo '之间';
    }else{
         echo '非之间';
    }
      

  3.   


    我一般用此方法  date("H:i:s") 这样输出来的结果就是楼主所要的结果