Watercolor Zebra Swallowtail Butterfly

Watercolor Zebra Swallowtail Butterfly

Watercolor Ormond Beach

Watercolor Ormond Beach

Automatic Copyright Date Update Script

I ran across a site yesterday, which is updated regularly and has quite a bit of good content, but I was slightly annoyed when I got to the bottom of the page and saw a “© 2003-2006″ — it’s already 2009! What that tells me is, while the site is updated regularly with new and unique content, the site owner hasn’t bothered to update the Copyright statement. There are reasons to keep it updated. First, to viewers like me it shows a lack of real site maintenance. Second, there could be some legal aspects to technically “claiming” content produced in, say, 2008, was Copyright two years prior.

Anyway, as frivolous as it is, I am surprised the good folks over at WordPress haven’t set this up to automatically update based on the date of installation, or at least make it an option to display the Copyright statement from the current date since the date of install.

Whatever! I digress. For those of us who are particular about stuff like this, here’s a quick and painless PHP script you can add to the Copyright statement of your PHP-based website, WordPress or otherwise, to automatically change to reflect the current year.

Copyright ©
<?php
if (date('Y') !== '2009') {
echo '2009-' . date('Y'); }
else
echo date('Y');
?>

You could change 2009 to whatever date you like, but the output of this script all year will be Copyright ©2009, then at midnight on December 31st, the statement will magically change to Copyright ©2009-2010 and so on for subsequent years. Just me, I’d rather do it once and forget about it. I use this on all the sites I build. Hope you find it useful! Happy New Year!

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15  Next Page »