PHP Newb issue with time and date
Posted: Fri Aug 21, 2009 7:10 am
Hi there,
This will probably be easy for you guys.
I'm trying to run an echo print based on a certain time and the actual day.
Required values are after 5pm and before 9am and on a Sat or Sun.
This is what i have but it doesnt work properly. Any pointers?
$today = date("w");
$current_time = date(G);
if ( $current_time < 9 || current_time > 17 || $today==0 || $today==6) {
echo "I'm sorry you have reached us out of hours!<br> Please try again between Mon-Fri 9am-5pm.";
exit;
}
Thanks in advance..
This will probably be easy for you guys.
I'm trying to run an echo print based on a certain time and the actual day.
Required values are after 5pm and before 9am and on a Sat or Sun.
This is what i have but it doesnt work properly. Any pointers?
$today = date("w");
$current_time = date(G);
if ( $current_time < 9 || current_time > 17 || $today==0 || $today==6) {
echo "I'm sorry you have reached us out of hours!<br> Please try again between Mon-Fri 9am-5pm.";
exit;
}
Thanks in advance..