Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getslot($day) {
- $current_time = strtotime('now');
- #echo $day;
- #echo $date = date("Y-m-d H:i:s");echo "\n";
- #echo $current_time."\n";
- #echo strtotime("today 12:00pm");
- if ($current_time > strtotime('today 12:00am') && $current_time < strtotime('today 2:00am')) { $slot=1; }
- if ($current_time > strtotime('today 2:00am') && $current_time < strtotime('today 4:00am')) { $slot=2; }
- if ($current_time > strtotime('today 4:00am') && $current_time < strtotime('today 6:00am')) { $slot=3; }
- if ($current_time > strtotime('today 6:00am') && $current_time < strtotime('today 8:00am')) { $slot=4; }
- if ($current_time > strtotime('today 8:00am') && $current_time < strtotime('today 10:00am')) { $slot=5; }
- if ($current_time > strtotime('today 10:00am') && $current_time < strtotime('today 12:00am')) { $slot=6; }
- if ($current_time > strtotime('today 12:00pm') && $current_time < strtotime('today 2:00pm')) { $slot=7; }
- if ($current_time > strtotime('today 2:00pm') && $current_time < strtotime('today 4:00pm')) { $slot=8; }
- if ($current_time > strtotime('today 4:00pm') && $current_time < strtotime('today 6:00pm')) { $slot=9; }
- if ($current_time > strtotime('today 6:00pm') && $current_time < strtotime('today 8:00pm')) { $slot=10; }
- if ($current_time > strtotime('today 8:00pm') && $current_time < strtotime('today 10:00pm')) { $slot=11; }
- if ($current_time > strtotime('today 10:00pm') && $current_time < strtotime('today 11:59pm')) { $slot=12; }
- #echo time('now');
- #$thetime = date("h:i a");
- #$time = strtotime("+2hours");
- #print date('l jS \of F Y h:i:s A', $time);
- #cho $thetime;
- #echo $slot;
- #echo "slot: ".$slot."\n";
- return $slot;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement