var hour = date.getHours()
if(hour<4){//0~3:59:59
location.href='/a'
}else if(hour>4){5~23:59:59
location.href='/b'
}else{//4~4:59:59
var second = date.getSeconds()
var minute = date.getMinutes()
if(second + minute === 0){//4:0:0
location.href='/a'
}else{//4点其他时间
location.href='/b'
}
}
var now=new Date()//获取当前时间
var Hour=now.getHours()
//获取当前小时
if(Hour>0&&Hour<8){
location.href="xxxx.html"
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)