Posts tagged “Javascript”

Thursday, 10 May 2012

How to Have Your Copyright Date Code Automatically Update

In the past week its seems like I’ve run across a shockingly large number of current, recently-updated websites that have outdated copyright dates. Some as old as 2004.

Come on, people! It’s 2012! You should either (A) remember to update your website’s copyright every year or (B) stick in a code that automatically makes your copyright current forever. It’s incredibly easy! Here, I’ll do it for you. Just stick this piece of code where your [©YEAR] is currently in your template:

<script type="text/javascript">
    var dayte = new Date();
    var copydate = dayte.getFullYear();
    document.writeln("&copy; "+copydate);
</script>

Et voila! Your website’s copyright notice will now always be the current year, no matter what. You’re welcome.

Or, of course, you can do what I do and not copyright your website at all; This is Chris dot com is all Creative Commons licensed, which I think is much simpler and much more fun & friendly.

Categories: Computers.