ItSolutionStuff.com

PHP Add Minutes to Time Example

By Hardik Savani • May 14, 2024
PHP

Here, i will show you how to works how to add minutes to time in php. this example will help you php add minutes to time. you'll learn add 15 minutes to time in php. if you want to see example of how to add 10 minutes to current time in php then you are a right place. Let's get started with add 5 minutes to current time in php.

I will give you very simple example how to add minutes to datetime in PHP. so let's see both example with output:

Example 1: PHP Add Minutes to Time

index.php

<?php

$date = "10:10:05";

$newDate = date('H:i:s', strtotime($date. ' +10 minutes'));

echo $newDate;

?>

Output:

10:20:05

Example 2: PHP Add Minutes to Current DateTime

index.php

<?php

$newDate = date('H:i:s', strtotime('+10 minutes'));

echo $newDate;

?>

Output:

04:05:51

i hope it can help you...

Tags: PHP
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

PHP Subtract Year from Date Example

Read Now →

PHP Subtract Month from Date Example

Read Now →

How to Subtract Days to Date in PHP?

Read Now →

How to Add Year to Date in PHP?

Read Now →

How to Add Months to Date in PHP?

Read Now →

How to Add Days to Date in PHP?

Read Now →

How to Get Minimum Key Value of Array in PHP?

Read Now →

How to Find Day Name from Specific Date in PHP?

Read Now →