My first post for a month, but a useful one nonetheless. It always paints a bad impression when you visit a website and the footer copyright says 2003. Basically the last time the web designer was involved with the client.

This handy snippet of code will make sure your site doesn’t look so obviously stale.
<script type=”text/javascript”>
<!–
var currentTime = new Date()

var year = currentTime.getFullYear()
document.write(year)
//–>
</script>

Simpy insert it in the HTML where you would have had the year, and it will always pull the current year.

2 Responses to “Automatically updating the copyright date on your website”

  1. paul Says:

    Personally I use something that is done server side, in case the SEs don’t execute javascript.
    Something along the lines of

    Paul

  2. paul Says:

    oops PHP code was filtered out… anyway enclose this in PHP tags
    echo “copyright: 2003 – “. date(“m/d/y”);

Leave a Reply