How to do something between exact two dates in PHP?Sometimes you need to show something on your website in timeframe. This snippet will show you how to do it precisely: File: between_dates.php ----------------------- <?php $showDate = "2019-07-16 20:00:00.0"; $hideDate = "2019-07-22 20:00:00.0"; $timezone = new DateTimeZone('Europe/Warsaw'); $now = new DateTime(); $now->setTimezone($timezone); // If in timeframe if( $now > new DateTime($showDate, $timezone) && $now < new DateTime($hideDate, $timezone) ) { do_something(); } Published by Konrad Fedorczyk I'm interested in programming and gamedev. I especially luv HTML5 and everything connected to web technologies. View all posts by Konrad Fedorczyk