LMS16
13-01-2011, 08:22 AM
Hey,
A little tricky question (or simple :P)
Ive got a script that I am running on a 5 minute cron & want it only to run after 07:30 and to stop running after 20:00.
How would I make PHP do this?
I thought of something like..
if(date("H:i") >= date("H:i", "07:30") && date("H:i") <= date("H:i", "20:00")){
echo "The time is after 07:30 and before 20:00";
exit();
}else{
echo "The time is before 07:30 or after 20:00";
exit();
}
Doesnt work though :S someone help? +REP :)!
Lew.
A little tricky question (or simple :P)
Ive got a script that I am running on a 5 minute cron & want it only to run after 07:30 and to stop running after 20:00.
How would I make PHP do this?
I thought of something like..
if(date("H:i") >= date("H:i", "07:30") && date("H:i") <= date("H:i", "20:00")){
echo "The time is after 07:30 and before 20:00";
exit();
}else{
echo "The time is before 07:30 or after 20:00";
exit();
}
Doesnt work though :S someone help? +REP :)!
Lew.