Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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"
 
PREVIOUS NEXT
Tagged: #time #left #laravel #seconds
ADD COMMENT
Topic
Name
4+3 =