Bladephp: Now with 7+ codeigniter, php, and laravel project 7+ php project From $18/Year From Rs. 1000/Year

How to Subtract One Hour in Current Date and Time using PHP

by
Category:php
php
How to Subtract One Hour in Current Date and Time using PHP

The following is really easy way to subtract one hour in current date and time using PHP. Using the date function to set the format of the date to be returned then using strtotime. You may also like How to Subtract Minutes to Date and Time in PHP and How to Add Hours to Date and Time in PHP.

PHP Code

<?php
    $start = date('Y-m-d H:i:s');
    echo date('Y-m-d H:i:s',strtotime('-1 hour',strtotime($start)));
?>

And if you like this tutorials please share it with your friends via Email or Social Media.


0 Comments


Html code work in comment box


Related Post