[Solved] Why is PHP printing variables used in if statement?


Here is what worked for the logic of showing updated post date and time if post is updated and if not just show published date and time for WORDPRESS

<?php $u_time = get_the_time('U'); 
$u_modified_time = get_the_modified_time('U'); 
if ($u_modified_time >= $u_time + 86400) { 
echo " [UPDATED] "; 
the_modified_time('F j, Y'); 
echo " at "; 
the_modified_time(); }
else {
echo get_the_date(); echo " at ";  echo the_modified_time(); echo " EST";
}
?>

So anyone looking to implement this on their wordpress website. go for it!!!
Solved it myself after hours of back and forth

solved Why is PHP printing variables used in if statement?