Created
July 28, 2022 07:33
-
-
Save vdonchev/46bdc7450db0091a4283a63272322741 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$now = new DateTime(); | |
$run_01_start = (new DateTime())->setTime(0, 0); | |
$run_01_end = (new DateTime())->setTime(1, 0); | |
$run_02_start = (new DateTime())->setTime(12, 0); | |
$run_02_end = (new DateTime())->setTime(13, 0); | |
$run_03_start = (new DateTime())->setTime(18, 0); | |
$run_03_end = (new DateTime())->setTime(19, 0); | |
if ( | |
($now >= $run_01_start && $now <= $run_01_end) | |
|| ($now >= $run_02_start && $now <= $run_02_end) | |
|| ($now >= $run_03_start && $now <= $run_03_end) | |
) { | |
echo 'Running :)'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment