//目的,2019年起,我们商城上面,早上4到8时禁止云购,实现方式
date_default_timezone_set("Asia/Shanghai");//规定时区
$j=date("H:i");
$now=strtotime($j);//获得当前小时和分钟的时间时间戳
$start=strtotime('04:00');//获得指定分钟时间戳
$end=strtotime('08:00');
if(time()>1546272000){ //19年1月1日起开始实施
if($now>$start && $now<$end){
exit('早上4点0分至8点0分之间,禁止报名.8点后恢复正常.');
}
}
php判断时间段
最新推荐文章于 2023-11-02 17:31:54 发布