How do I get the user id of a blog creator?

I am working inside a functions.php file of a child theme of the BuddyPress default theme. I need to get the user id of the person who created the blog. Have tried.

global $bp_blogs_template;
$creator_id = $blogs_template->blog->admin_user_id;