How to display a linked category name with get_the_category

get_the_category() returns the array of WP_Term objects. So,

// get all categories objects
$categories = get_the_category();
// get the first category name
if ( ! empty( $categories ) ) {
    $category = $categories[0]->name;
}

$output .= '<li><a href="https://wordpress.stackexchange.com/questions/293636/" . get_the_permalink() . "https://wordpress.stackexchange.com/questions/293636/">';
$output .= get_the_title() . '</a> ';
$output .= $category ."https://wordpress.stackexchange.com/questions/293636/";
$output .= get_the_time('d M Y') . '</li>';