In what way is it affecting your post thumbnails?
I cleaned up your code a bit. If you can show me the output you’re getting I’ll be able to help you further.
<?php
global $post;
$compare_date = strtotime( "2018-03-01" );
$post_date = strtotime( $post->post_date );
if ( has_post_thumbnail() ) {
if ( $compare_date < $post_date ) {
echo '<div style="float:right;padding-left:20px;"><img src="' . the_post_thumbnail() . '"/></div>';
}
else {
echo '<img src="' . the_post_thumbnail() . '" />';
}
}
?>