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.
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 ©2007 Your Web Site</p>
By the way,
© is the © symbol.
Client-side Code Method
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 ©<?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.