Get the author registration date in the header.php file

If you are using this on author pages or in loop then you can simply use this.

echo the_author_meta( 'user_registered' );

This will output registration date of author.

So your function will become.

if ( is_author() ) {
    $curauth = ( isset($_GET['author_name']) ) ? get_user_by( 'slug', $author_name ) : get_userdata( intval($author) );
    $date = the_author_meta( 'user_registered' );
}