Use Only Genuine Interocitor Parts

Add to Technorati Favorites

Endorsements

Firefox 3

Eternally Up To Date Copyrights

Wednesday, July 25th, 2007 at 11:48 pm by Kenny

I can't tell you how many times, both personally and professionally, I've come across web sites that have out of date copyright dates. A living, breathing, up to date site should have a current copyright date somewhere on the page, usually in the footer. Changing the year is easy enough if it's static, but it's one of those things you have to remember to do (and you have to know how to do it). If your code isn't modularized (that is, if every page has the copyright date hard coded), then having to change these dates each year could be a very laborious process, even if you're savvy enough to use a global find and replace.

Why should you even have to make this update by hand? The web page should know that the copyright year is always the current year. There are a couple of ways to do this, depending on what you have available on your web server.

Concept

The concept behind this technique is very simple. You simple replace the year with a dynamically written number pulled from the supporting language's date functions. Here is the static code that we will start with:

<p>Copyright &amp;#169;2007 Your Web Site</p>

By the way, &amp;#169; is the © symbol.

Client-side Code Method

If you don't have any access to a dynamic server-side technology such as PHP, Java, Python, Perl, .NET, or some other programming language, then you will need to use Javascript. Here's an example of generating the year dynamically with client-side Javascript:

<p>Copyright &amp;#169;
<script type="text/javascript">
    var date = new Date();
    document.write(date.getFullYear());
</script>
Your Web Site</p>

The downside to this method is that, since the date is rendered by the browser, it is dependent upon the client's environment. If the user has Javascript disabled or if there is just some other unpredictable variable in the client's browser then the copyright year will be completely missing rather than just a year or two out of date. The other problem that arises is this: if the client's computer has the year set to 1963, then the copyright date on the web page will appear as 1963.

Server-side Code Method

If you have the ability to utilize a server-side technology, such as PHP, then you should. This method is preferred because you control the behavior and the date is written to the client as plain text. That is, it is rendered on the server and then streamed to the client as plain text. Here's an example in PHP of server-side dynamic copyright year text:

<p>Copyright &amp;#169;<?php echo date('Y'); ?> Your Web Site</p>

I could list out a dozen examples of how to dynamically generate the year, but I would probably end up leaving out the specific language that you are looking for. You can use this technique with any language. Yes, I know this isn't a ground-breaking technique, it's just printing the year, but I've seen enough examples of people with out of date copyright years that I thought this was a worthwhile tip to share. Good luck.


  • E-mail this story to a friend!
  • Google
  • Digg
  • Technorati
  • del.icio.us
  • Slashdot
  • TwitThis
  • Furl
  • Fark
  • Reddit
  • StumbleUpon
  • Facebook

Posted in Web Development |

You can follow any responses to this entry through the RSS 2.0 feed. Trackback from your own site.

2 Responses to “Eternally Up To Date Copyrights”

  1. ValkRaider - Thursday, July 26th, 2007 at 7:27 am :

    Wouldn't updating the copyright date when you haven't updated the content actually be legally questionable?

    Also, in some cases it might be more appropriate to maintain the older copyright date to help establish "prior art" type claims.

    Ideally the copyright date should only change when content is changed, not when content is viewed. Perhaps a way to have the copyright reflect the last modification date of the file or some such process…

    Or I could just be making all this up.

    But heck, with copyrights in the USA now lasting 72 billion years (or 144 billion years if you are Disney) - what is the real reason to make sure that your copyright stays up to date? In fact, your "Copyright 1993" web pages simply add authenticity and a "retro" feel - while the copyright is still legally enforceable. Heck, nothing makes you more "l33t" than having a web page you published back when the web was ALLCAPS and blink tags, you know, back when Yahoo was still useful.

  2. Kenny - Thursday, July 26th, 2007 at 8:10 am :

    Yeah, I think you're right about the copyright year (or more specifically, the copyright date) needing to reflect the work's actual creation or modification date. However, the type of copyright I'm talking about is like the one you see in the footer of this site.

    I think of it more as a site copyright rather than an individual work copyright. That is, the copyright refers to the concept, layout, etc. The intent is more of a copyright of the overall site, not the content on a specific page.

    Following your logic, which I agree with, I should also have a copyright near that contained work that refers to the copyright of the specific content. …like I'm about to do here. :o) ©2007

Leave a Reply