Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,038 questions

40,787 answers

573 users

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 50 views
1 answer 51 views
1 answer 83 views
1 answer 85 views
...