W3docs

How to add 5 minutes to current datetime on php < 5.3

You can use the strtotime function in PHP to add a certain number of minutes to a date and time.

You can use the strtotime function in PHP to add a certain number of minutes to a date and time. For example, to add 5 minutes to the current date and time:

Example of using the strtotime function in PHP to add a certain number of minutes to a date and time

<?php

$current_time = time();
$new_time = $current_time + 5 * 60;
$new_datetime = date('Y-m-d H:i:s', $new_time);

echo "Current Time: " . date('Y-m-d H:i:s', $current_time) . "\n";
echo "New Time (5 minutes in the future): " . $new_datetime . "\n";

?>

<div class="alert alert-info flex not-prose"> Watch a course <span class="hidden md:block">Watch a video course </span> Learn object oriented PHP</div>

Here, time() gets the current timestamp, then we add 5 minutes (5 * 60 seconds) to the timestamp. Then, date function is used to format the timestamp in the desired format.