I want to include script only on certain time from 7:00AM US time and turn off at 1:00PM .
This is what I have:
date_default_timezone_set( 'America/New_York' );
$time = date( 'H' ); ?>
<script>console.log('<?php echo $time; ?>');</script>
<?php if($time >= 07 && $time <= 01) : ?>
<script>alert("That works!");</script>
endif;
I understand that I'm trying to compare a larger number firstly, but don't understand what I need to do.
24-format doesn't work too.
Thanks!