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 126 views
1 answer 117 views
1 answer 132 views
1 answer 106 views
106 views asked Mar 29, 2022 by avibootz
1 answer 185 views
1 answer 173 views
1 answer 164 views
...