Automatic Copyright Year Updater

Posted on October 6, 2008 at 10:43 pm.

Have you ever given your websites a once over and all of a sudden noticed your footer has a copyright 1996 All Rights Reserved? Ack, what if you have 20 or 30 web sites? Do You have to go through each one and update the footer every year?

Try this

Copyright © 2008
<script language="JavaScript">
    var d=new Date();
    yr=d.getFullYear();
    if (yr!=2008)
    document.write("- "+yr);
</script>

This little JavaScript reads the year on the user’s computer and displays it in your footer. You never have to update the Copyright statement again.

Actually, in the script above, we have this years date (or the year of conception), followed by the script which first checks the system date and compares it to this years date, 2008. If it is still 2008 nothing is written. If it is not 2008 a dash and the current year is written. So, next year, 2009, the above footer text will read “Copyright © 2008 – 2009″. No manual updating.

Bookmark and Share

Tags


2 Responses to “Automatic Copyright Year Updater”

Leave a Reply