How to subtract 12 hours from current date in PHP

1 Answer

0 votes
$currentDate = time(); 
 
$date = strtotime(date("Y-m-d H:i:s", $currentDate) . "-12 hours"); 
 
echo date('r', $date); 
 
  
 
 
/*
run:
 
Thu, 24 Mar 2022 19:48:15 +0000
 
*/

 



answered Mar 25, 2022 by avibootz

Related questions

1 answer 137 views
1 answer 140 views
1 answer 180 views
1 answer 200 views
1 answer 141 views
1 answer 128 views
128 views asked Mar 24, 2022 by avibootz
...