How to subtract 1 day and 12 hours from current date in PHP

1 Answer

0 votes
$currentDate = time(); 
 
$date = strtotime(date("Y-m-d H:i:s", $currentDate) . "-1 day -12 hours"); 
 
echo date('r', $date); 


  
 
 
/*
run:
 
Wed, 23 Mar 2022 19:53:24 +0000
 
*/

 



answered Mar 25, 2022 by avibootz

Related questions

1 answer 231 views
1 answer 216 views
1 answer 220 views
1 answer 184 views
184 views asked Mar 29, 2022 by avibootz
1 answer 288 views
1 answer 272 views
1 answer 270 views
...