Copyright 2016

When you work on a website it’s important to keep it up to date, including the date in the copyright notice.

I sometimes forgot to update this myself, I admit. But there are a few things you could do to lower the amount of work. Such as using a scripting or programming language to automate the copyright year in the footer. This way you can focus on the content instead.

tl;dr Once a year I check my live web sites to see if the copyright notice actually says the right year. If not, It’s probably still static, and then I update the footer code to automate this process with a little code snippet.

It’s a new year everybody, so please check your site’s footer for the copyright notice. It has to say the current year. You still haven’t automated this? I usually add the URL of the site in front of the word copyright, and the name or company name at the end (see the screenshots below for an example).

Here’s how I do it in PHP: (My preferred method)

Copyright &copy; <?=date("Y")?>

Here’s how I do it in JavaScript: (Note: This is client-side)

Copyright &copy; <script>document.write(new Date().getFullYear());</script>

And here’s how to do it in Ruby:

Copyright &copy; <%= Time.now.year %>

If you have a website and need some help changing the code, feel free to contact me. Maybe I can help.

Source code as I use it on mrfloris.com:
copyright code

And how it looks:
copyright notice

Fun-fact about mrfloris.com: the years are a range from 1977 to current. This is my personal blog (which is about me), I thought it would be fun to start the copyright at my year of birth.


Posted

in

by

Tags: