Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel seconds to hours minutes seconds

$value = '90060';
$dt = Carbon::now();
$days = $dt->diffInDays($dt->copy()->addSeconds($value));
$hours = $dt->diffInHours($dt->copy()->addSeconds($value)->subDays($days));
$minutes = $dt->diffInMinutes($dt->copy()->addSeconds($value)->subDays($days)->subHours($hours));
echo CarbonInterval::days($days)->hours($hours)->minutes($minutes)->forHumans();
Comment

time left laravel seconds

//seconds and human time readable
$endTime = Carbon::parse("2021-09-23 19:15:16");
$startTime = Carbon::parse("2021-09-23 19:15:14");
$timeleft = $startTime->diffForHumans($endTime);
return $timeleft;
//output => time_left: "2 second before"
Comment

PREVIOUS NEXT
Code Example
Php :: excerpt more wordpress 
Php :: int to char php 
Php :: laravel get file in public folder 
Php :: laravel return view in web.php 
Php :: laravel model where 
Php :: set a minimum character value in php 
Php :: create a custom method laravel model 
Php :: php string nach zeichen zerlegen 
Php :: how to alias table name in laravel model 
Php :: softdeletes laravel 
Php :: php return function result to variable 
Php :: get_the_category() 
Php :: PHP min() and max() 
Php :: laravel insert array 
Php :: file form validation codeigniter 
Php :: php location header 
Php :: in_array php 
Php :: random element in faker 
Php :: check installed php modules in linux 
Php :: laravel 8 query builder 
Php :: wpdb get last query 
Php :: array key value php 
Php :: composer remove phpmailer 
Php :: pretty json php 
Php :: Get all Country List using php 
Php :: withdefault laravel 
Php :: grouping routes based on controller laravel 
Php :: php ip log 
Php :: how to data save usigng request all laravel 
Php :: calling fucnction in an other function php 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =