I've got a redirect script meant to not redirect between certain times. I'm using Date("G"), but if I use this for say 12:30, it won't work because I believe 030 is read as 0 and not 30. Will a seperate statement like if $hour = 0 {$hour = $hour + 1}
and then writing $milTime
as 130 work? If so, is this the best way? If not, what will work?
Here's an example of a time block that won't read correctly.
<?php
date_default_timezone_set('America/Los_Angeles');
$hour = date("G");
$min = date("i");
$milTime = $hour . $min ;
if($milTime < 030 || $milTime > 045)
{
header('Location: http://havetowatchit.com/watchit.php');
exit();
}
?>