Page 1 of 1
time interval
Posted: Fri Dec 17, 2010 10:23 am
by pedroz
what is the best way to check this time interval?
from 8th December to 8January, every year!
if (time interval) {
// echo something;
}
Re: time interval
Posted: Fri Dec 17, 2010 11:22 am
by pedroz
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
Re: time interval
Posted: Sat Dec 18, 2010 2:07 am
by Darhazer
Code: Select all
<?php
$day = date('d');
$month = date('m');
if (($month == 12 && $day > 7) || ($month == 1 && $day <9)) {
...
}