[quote author=pkSML link=topic=108166.msg435291#msg435291 date=1158368531] This code is fixed. I hope the syntax is proper. date(z) does not need to take into account the month because it just returns the day of year. This updated code makes sure that the year is the same. [code]<?php while ($x = mysql_fetch_array($result)) { list($mon, $day, $year) = explode('-', $x['dateadded']); $day = date('z', mktime(0, 0, 0, $mon, $day, $year)) + 1; // day of year for datestamp $thisyear = date("Y"); $today = date("z") + 1; // today's day of year if ((($today - $day) < 7) && ($year == $thisyear)) { // show your image here since it's new! echo "<img src='/images/new.gif'>"; } } ?>[/code] [/quote] I ran this, but it doesn't show anything even though the selected record has the dateadded as 3 days ago. Any ideas? Thanks. Peter