Edit the code to this:
add_filter( 'generate_post_date_output', function( $output, $time_string ) {
$time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">Published on %2$s</time>';
if ( get_the_date() !== get_the_modified_date() ) {
$time_string = '<div><time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified">Updated: %4$s</time></div>
<div><time class="entry-date published" datetime="%1$s" itemprop="datePublished">Published: %2$s</time></div>';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
return sprintf( '<span class="posted-on">%s</span> ',
$time_string
);
}, 10, 2 );
Please take note such date structure creation is possible with GP Premium and providing PHP support to create it would be out of our scope here in this forum. For further inquiries regarding this level of support, kindly reach out to us in the Premium forum.