-2

I'm trying to get time interval after 12AM until 21PM. but I don't know how to do it and confused how to put it in the right statement.

well, I need a conditional statement like this: can someone help me?

$date = '2016-23-05 13:00:00';

if($date > 12:00:00 and $date < 21:00:00){  
//some functions
}
else{ 
//some functions
}
Henrikus Anthony
  • 154
  • 2
  • 4
  • 12

1 Answers1

1
If(date("His", strtotime($date)) > 120000 && date("His", strtotime($date)) < 210000)
Andreas
  • 23,610
  • 6
  • 30
  • 62