Time interval

what is the best way to check this time interval?
from 8th December to 8January, every year!

if (time interval) {
// echo something;
}

Being more specific

if (today = 7 december) //false
if (today = 8 dec) // true
if (today = 9 dec) // true
if (today = 10 dec) // true

if (today = 7 jan) // true
if (today = 8 jan) // true
if (today = 9 jan) // false


<?php

$day_of_year = date('z');
$within_range = false;
$leap_year = date('L');

if($day_of_year >= (341 + $leap_year) || $day _of_year < 9) {
    $within_range = true;
}

?>

Using this code $within_range will be true if the date is between December 8 and January 8. :slight_smile: