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.
Tags: html, web design
Posted April 24, 2009 by Ciaran under Clients, Web development




July 30th, 2009 at 8:30 am
Personally I use something that is done server side, in case the SEs don’t execute javascript.
Something along the lines of
Paul
July 30th, 2009 at 8:30 am
oops PHP code was filtered out… anyway enclose this in PHP tags
echo “copyright: 2003 – “. date(“m/d/y”);