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 122 views
1 answer 126 views
1 answer 164 views
1 answer 185 views
1 answer 131 views
1 answer 115 views
115 views asked Mar 24, 2022 by avibootz
...