Nothing earth shattering today, but a nice little new year item for your web site.
Many web pages carry copyright notice that reflects the creation date of some or all of the content – Copyright 2003-2009 for example.
This is great until the year changes and you need to go back and update all your web pages. You can and should make this function easier with the use of footer library files or SSIs, so you only need to update once place and have it cross all your pages. But, you can even take it a step further and have the date change automatically.
Most blog themes have this function using a simple PHP call –
Copyright © 2003-< ?php echo date('Y'); ?> – this would produce Copyright 2003-2009, and change to 2010 automatically next year.
Copyright Â© xxxx
var d=new Date();
Replace the xxxx in both places with the year you would like to publish as the start year and then the script will take care of the rest. So for me it’s 1999 and looks like this Copyright Â© 1999 – 2009. Again, this will change to 2010 next year at this time without any effort on my part.
I’m sure there are a dozen other ways to get this done, but now you know it’s possible!