Laravel Carbon addMinutes() | Laravel Carbon Add Minutes Example
In this tutorial, we will be demonstrating how to add minutes using Laravel Carbon. We will provide examples on how to add 1 minute and how to use the addMinutes()
method. This will help you add minutes to a date in Laravel.
Using Laravel 6, Laravel 7, Laravel 8, Laravel 9, and Laravel 10 versions, you can easily add minutes to the current date using Carbon.
If you need to add a minute or more to a date, you can utilize Carbon in Laravel. Carbon offers the addMinute()
and addMinutes()
methods to add minutes to a Carbon date object. Let's explore some examples of how to add minutes and substract minutes and years from a date using Carbon.
use Carbon\Carbon;
$date = Carbon::parse('2023-03-12 09:30:00');
$futureDate = $date->addMinute();
echo "Initial Date and Time: ".$date."
";
echo "Future Date and Time: ".$futureDate;