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

The following is really easy way to subtract one Minute in current date and time using PHP. Using the date function to set the format of the date to be returned then using strtotime.

PHP Code

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

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

Leave a Reply

Your email address will not be published. Required fields are marked *