Fateh Alrabeai
Fateh Alrabeai

Reputation: 730

How to get time after 20 minutes from now using carbon in laravel?

I want to get the time after 20 minutes from now using carbon in laravel. How can I do that?

$minutes = 20;

$delivery_time =Carbon::now()->add($minutes,'minute')->format('h:m');

Upvotes: 1

Views: 2111

Answers (1)

Justin Kruskie
Justin Kruskie

Reputation: 422

Try using this:

Carbon::now()->addMinutes($minutes)->format('h:m')

Documentation: https://carbon.nesbot.com/docs/

Upvotes: 3

Related Questions