Output the text before category

I don’t see why you can not use plain text like tho

Posted on <?php the_time('F j, Y') ?> in <?php the_category(); ?>

If what you are asking is really important, just wrap the function like this

my_custom_category($before="",$after=""){
echo $before;
the_category()
$echo $after;
}

If the_category is not picking the post ID, then pass it manually.