Search
 
SCRIPT & CODE EXAMPLE
 

PHP

diffinhours with minutes carbon

$start = new Carbon('2021-01-01 00:00:00');
$end = new Carbon('2021-01-01 07:26:00');

// One line solution
$start->diff($end)->format('%H:%I:%S'); // 07:26:00

// OR
$totalDuration = $end->diffInSeconds($start); // 21
gmdate('H:i:s', $totalDuration); // 07:26:00
Comment

PREVIOUS NEXT
Code Example
Php :: json encode decode php 
Php :: unset php 
Php :: setup cron on macos for laravel 
Php :: Copy file from one directory to another Laravel 
Php :: how to make a config file for php 
Php :: laravel get current route url 
Php :: wp_customize_image_control 
Php :: laravel eloquent set timestamps values upon seed 
Php :: Laravel Model Create Artisan Commant 
Php :: string and number laravel faker 
Php :: how to display the database table names list in codeigniter 
Php :: How to create and access angular HTTP params in PHP 
Php :: php if elseif 
Php :: php insert array into mysql table 
Php :: carbon greater than 
Php :: php var use in javascript 
Php :: laravel get age from date 
Php :: laravel set field unique 
Php :: cambiare pagina php 
Php :: Get wordpress posts by category name..! 
Php :: laravel casts 
Php :: shortcode in wp 
Php :: what does defined di in php 
Php :: html to pdf in php 
Php :: laravel request get parameter 
Php :: showing from to in larvel pagination 
Php :: wordpress wp_logout_url redirect 
Php :: Remove revisions from Wordpress pages 
Php :: random string value laravel 
Php :: phpunit test private function 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =