public function getFormattedDuration($seconds)
    {
        $duration = ceil($seconds) . ' seconds';

        if ($duration > 60) {
            $duration = round($duration / 60, 1) . ' minutes';
        } elseif ($duration > 3600) {
            $duration = round($duration / (60 * 60), 1) . ' hours';
        } elseif ($duration > (24 * 60 * 60)) {
            $duration = round($duration / (24 * 60 * 60), 1) . ' days';
        }

        return $duration;
    }
public function getFormattedDuration($seconds)
    {
        $duration = ceil($seconds) . ' seconds';

        if ($duration > 60) {
            $duration = round($duration / 60, 1) . ' minutes';
        } elseif ($duration > 3600) {
            $duration = round($duration / (60 * 60), 1) . ' hours';
        } elseif ($duration > (24 * 60 * 60)) {
            $duration = round($duration / (24 * 60 * 60), 1) . ' days';
        }

        return $duration;
    }
public function getFormattedDuration ( $ seconds ) { $ duration = ceil ( $ seconds ) . ' seconds' ; if ( $ duration > 60 ) { $ duration = round ( $ duration / 60 , 1 ) . ' minutes' ; } elseif ( $ duration > 3600 ) { $ duration = round ( $ duration / ( 60 * 60 ) , 1 ) . ' hours' ; } elseif ( $ duration > ( 24 * 60 * 60 ) ) { $ duration = round ( $ duration / ( 24 * 60 * 60 ) , 1 ) . ' days' ; } return $ duration ; }
Format a duration in seconds to human readable

@param int $seconds the time to format
@return string
Format a duration in seconds to human readable