Jump to content

mflevie44

New Members
  • Posts

    6
  • Joined

  • Last visited

mflevie44's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. txtPDate = 01-10-2013 txtPTime = 15.30
  2. $pDate = $_GET['txtPDate']; $pTime = $_GET['txtPTime']; $varDat = strtotime($pDate); $varTime = strtotime($pTime); $nxtDay = strtotime("+1 day", $varDat); $lowerTime = strtotime("07.30"); $upperTime = strtotime("20.30"); if($varDat < $nxtDay)// This comparison doesn't seems to be working { echo "Pick up Date atleast 24hrs after the current Date"; } else if(!($varTime >= $lowerTime) || !($varTime <= $upperTime)) { echo "Pick up Date atleast 24hrs after the current time"; }
  3. Thanks mate it solved the problem.....
  4. Can any one tell me what's wrong with this code? it's just keep giving me this message "Pick up Date atleast 24hrs after the current Date"; $pDate = $_GET['txtPDate']; $pTime = $_GET['txtPTime']; $dateArray = explode('-',$pDate); $timeArray = explode('.',$pTime); $hours = (int)$timeArray[0]; $minutes = (int)$timeArray[1]; $day = (int)$dateArray[0]; $month = (int)$dateArray[1]; $year = (int)$dateArray[2]; $userPTimes = mktime(date($hours),date($minutes),0,date($month), date($day), date($year)); $userCurrentTime = mktime(0, 0, 0, date($day), date($month), date($year)); $userupperlimit = mktime(date(7), date(30), date(0), date($day), date($month), date($year)); $userlowerlimit = mktime(date(20), date(30), date(0), date($day), date($month), date($year)); $dayafter = mktime(0, 0, 0, date($day +1), date($month), date($year)); // I wanted $dayafter to 24 hours after the $pdate if($userCurrentTime < $dayafter) { echo "Pick up Date atleast 24hrs after the current Date"; } else if(!($userPTimes >= $userupperlimit) || !($userPTimes <= $userlowerlimit )) { echo "Pick up Time should be between 7.30 - 20.30"; }
  5. For example lets say I want to check whether the user input is in between 7.30 and 20.30 how can i implement in php? Sorry if this seems to be a stupid question, I'm a beginner
  6. How can check This String '2013-09-12:14:00:01' is later than 24 hours of current time?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.