1Try to parse() it first:
2$date = Carbon::parse($dateTime)
3 ->addSeconds($seconds)
4 ->format('Y-m-d H:i:s');
1$now = Carbon::now();
2echo $now; // 2020-03-22 17:45:58
3echo "\n";
4$today = Carbon::today();
5echo $today; // 2020-03-22 00:00:00
6echo "\n";
7$tomorrow = Carbon::tomorrow('Europe/London');
8echo $tomorrow; // 2020-03-23 00:00:00
9echo "\n";
10$yesterday = Carbon::yesterday();
11echo $yesterday; // 2020-03-21 00:00:00
1You can use:
2----------------
3$minutes = 1510;
4$hours = intdiv($minutes, 60).':'. ($minutes % 60);
5!!! This only works with php >= v7.xx
6
7Previous answer:
8-------------------
9$minutes = 1510;
10$hours = floor($minutes / 60).':'.($minutes - floor($minutes / 60) * 60);