Using wp_tag_cloud with only posts published in specific year

All you can do is to find the post from current year and filter out the tags from those posts. Please see the code below,

$getdate = getdate();
$args = array(
    'date_query' => array(
        array(
            'year'  => $getdate["year"]
        ),
    ),
);
$query = new WP_Query( $args );

$years_tag = array();

if ( $query->have_posts() ): 

    while ( $query->have_posts() ) : 

        $query->the_post();

        $post_tags = wp_get_post_tags( get_the_id(), array( 'fields'=>'ids' ) );

        foreach ( $post_tags as $tag) {

            if( !in_array( $tag, $years_tag ) ) {
                array_push( $years_tag, $tag );
            }
        }

    endwhile; 
endif;

$args = array(
    'include' => implode(',', $years_tag),
);

wp_tag_cloud( $args );

You can accurately get tags from this year BUT the main issue here is the count of tags is not based on this year. You can manipulate the array to bring the count along with tag ids and create your own function on that.

I hope this will be somewhat helpful to you.

error code: 523