我需要做一个网站重定向到一个页面后21.45至10.00


I need to do a site redirects to a page after 21.45 to 10.00

我需要做一个网站重定向到21.45到10.00之后的页面我需要一个脚本,将做一个重定向网站到另一个页面在特定的时间。

事情是这样的

<?php
 $date = new DateTime('now');
         $date->setTimezone(new DateTimeZone('Europe/Athens'));
     if ($date->format('H')>=10 && $date->format('H')<=21  ){
        if ($date->format('H')==21 && $date->format('i')<45)    
          echo "<script>window.location = '/'</script>";                  
        else if($date->format('H')<21)
          echo "<script>window.location = '/'</script>";
     } 
?>

不太确定时区,但是

$hoursMinutes = intval(date("Hi"));
if($hoursMinutes >= 1000 && $hoursMinutes <=2145) {
    header("Location: /2");
} else {
    header("Location: /1");
}