指定固定时间段内登录,8.30到5.00

来源:互联网 发布:js修改class的值 编辑:程序博客网 时间:2024/05/17 03:10
$time=date('H:i');//获取当前时间的小时,分钟
$h=strtotime($time);//获得时间戳
$x=strtotime('08:30');
$d=strtotime('17:00');
if($h>$x&&$h<$d){
echo'显示时间是08:30到17:00分之间';
}