-2

how to add 3 hours to the current time in php ?

$expired = time() + "3 hours";
$time = time();

if($time < $expired){
    condition....
}
kamal pal
  • 4,187
  • 5
  • 25
  • 40

1 Answers1

1

The DATE_ADD() function will work.

DATE_ADD(NOW(), INTERVAL 2 HOUR)
kamal pal
  • 4,187
  • 5
  • 25
  • 40
Santosh Jagtap
  • 995
  • 8
  • 17