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— editable, runs on the server
<div class="alert alert-info flex not-prose">![]()
<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.