carbon add minutes
Carbon::now()->addMinutes($minutes)->timestamp;Carbon::createFromFormat('Y-m-d H:i:s', $request->date)->format('d-m-Y')$comment->created_at->diffForHumans();$now = Carbon::now();
echo $now; // 2020-03-22 17:45:58
echo "\n";
$today = Carbon::today();
echo $today; // 2020-03-22 00:00:00
echo "\n";
$tomorrow = Carbon::tomorrow('Europe/London');
echo $tomorrow; // 2020-03-23 00:00:00
echo "\n";
$yesterday = Carbon::yesterday();
echo $yesterday; // 2020-03-21 00:00:00Try to parse() it first:
$date = Carbon::parse($dateTime)
->addSeconds($seconds)
->format('Y-m-d H:i:s');You can use:
----------------
$minutes = 1510;
$hours = intdiv($minutes, 60).':'. ($minutes % 60);
!!! This only works with php >= v7.xx
Previous answer:
-------------------
$minutes = 1510;
$hours = floor($minutes / 60).':'.($minutes - floor($minutes / 60) * 60);
Also in PHP:
- arry reverse in php
- enable php errors
- PHPMailer
- file to binary php
- delete uploaded file php
- acf field without spaces
- comannd for rout in laravel
- date_format timeformat php
- Error: Cannot redeclare composerRequire1d8e02dff94f518b7a14ddcb6710f10d() (previously declared in /Applications/XAMPP/xamppfiles/htdocs/all4learn2/Vendor/composer/autoload_real.php:66)
- check if string in another string php
- PHP string mask day-year
- blade format date
- AWS HTTP error: Error creating resource: [message] fopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
- array unique by keys return 1 associative array item in php
- WooCommerce Add Long Description to Products on Shop Page with Character limit
- clear cache controller laravel
- artisan command for clearing cache
- br2nl
- does array have key php
- fetch data from live website curl php
- clear file cache laravel
- contains function in php
- find someone geo php
- clear all cache laravel