Conditional Tag Based on Age of Post [duplicate]

<?php
$today = date('r');
$articledate = get_the_time('r');
$difference = round((strtotime($today) - strtotime($articledate))/(24*60*60),0);
if ($difference >= 3) { ?>
this is a three day old post
<?php } ?>

the 3 in if ($difference >= 3) { ?> is 3 days old, you can change that to whatever you want. How I could do it, is add a css class to include the image.