Show content between time ranges

<?php $theDate = date("H:i"); $date = new DateTime( $theDate ); $date->setTimezone(new DateTimeZone('America/New_York')); echo $date->format('H:i'); $dayName = date('l'); // dayname; ?> <?php // Weekdays if( $dayName !== 'Saturday' || $dayName !== 'Sunday' ) : ?> <?php if(( $theDate >= '08:00' ) && ( $theDate <= '08:36' )) : ?> show dj <?php elseif(( $theDate >= '04:32' ) && ( $theDate <= '04:34' )): ?> Show Other DJ <?php elseif(( $theDate >= '04:35' ) && ( $theDate <= '04:37' )): ?> Show Other Other DJ <?php else: ?> <?php echo $dayName; ?> No DJs <?php endif ?> <?php // Saturday elseif( $dayName == 'Saturday' ) : ?> Saturday Dj <?php // Sunday elseif( $dayName == 'Sunday' ) : ?> Sunday DJ <?php else: ?> <?php endif ?>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.