Well to check if monday is today.
PHP Code:
$hour = date("H", mktime(date("H")));
$day = date("D");
if($day == 'Mon' && ($hour >= 16 && $hour < 19)) {
print "Its monday between 4 and 7 pm";
}
else {
print "Its not monday between 4 and 7 pm";
}
Now if you need to adjust the server time to account for a different time zone just change the first line. For example if you live in one time zone and the server is 2 hours behind you. Simply make the line
PHP Code:
$hour = date("H", mktime(date("H") - 2));
Or two hours ahead
PHP Code:
$hour = date("H", mktime(date("H") + 2));
Bookmarks