Tag: examples
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 < […]