I'm writing a function that works out whether or not the time is between 9am and 5pm on a working day. It then tells you when the next working day starts (if currently out of business hours) based on whether today's business hours have ended or (if after midnight) are about to begin.
All is going well so far, and to create the most readable code I could’ve used strtotime()
-– but how do you test strtotime()
?
Is there a way to alter the system time temporarily for testing purposes?