How To Subtract Hours To Current Date Time In Codeigniter?

Codeigniter

Nicesnippets

773

30-12-2020


Hi Guys,

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

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

Example:


public function index(){

//Remove to hours in current date time

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

}

Output:

2020-12-30 08:24:50

It will help you...


Recommended Posts