Custom entry_date function

You should be using get_the_date, rather than the_time (which will just echo the value). And always quote string arguments.

$date = sprintf( '<span class="date"><a href="https://wordpress.stackexchange.com/questions/132268/%s" title="https://wordpress.stackexchange.com/questions/132268/%s" rel="bookmark"><time class="entry-date" datetime="https://wordpress.stackexchange.com/questions/132268/%s"><span class="date--day">%s</span><span class="date--month">%s</span><span class="date--year">%s</span></time></a></span>',
    esc_url( get_permalink() ),
    esc_attr( sprintf( __( 'Permalink to %s', 'lyod' ), the_title_attribute( 'echo=0' ) ) ),
    esc_attr( get_the_date( 'c' ) ),
    esc_attr( get_the_date( 'd' ) ),
    esc_attr( get_the_date( 'M' ) ),
    esc_attr( get_the_date( 'Y' ) )
);