How To Subtract Hours To Current Date Time In Php?

Admin   PHP   142  2021-03-18 05:40:05

Hi Guys,

In this example,I will learn you subtract hours to current date time in php.you can easy and simply subtract hours to current date time in php.

we will show subtract hours in current date time php.this tutorial will give you example of subtract hours to current date time using php.

Example:

 

<?php

$date = date('Y-m-d H:i:s', strtotime('-2 hour'));

echo $date;

?>

Output:

 

2020-12-30 08:24:50

It will help you...