Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $timeStart = "01:30:00";
- $timeEnd = "06:00:00";
- // Gio G+0
- $timeNowFull = $_SERVER['REQUEST_TIME'];
- // Gio G+7
- //$timeNowFull = $_SERVER['REQUEST_TIME'] + 7*60*60;
- $timeNow = gmdate("H:i:s", $timeNowFull);
- $timestampStart = strtotime($timeStart);
- $timestampEnd = strtotime($timeEnd);
- $timestampNow = strtotime($timeNow);
- if (($timestampNow>$timestampStart) && ($timestampNow<$timestampEnd)){
- echo "OK";
- } else {
- echo "NOT OK";
- }
- // Xuat ra de check
- echo "<br>timeStart = $timeStart";
- echo "<br>timeEnd = $timeEnd";
- echo "<br>timeNow = $timeNow";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment