<< by on December 28th, 2009
If you’re like me, you can barely remember to put the new year correctly on your checks when you write them. So if you’re like me, you likely forget to change your copyright date on your website as well.
Here’s a simple solution that can alleviate having to remember to change your copyright date each year: do it programmatically! My theory in life is ‘Why do it manually when you can have a computer remember to do it for you?”. And this situation is no different.
No matter what type of website you have or what language it is programmed in, you can easily assign your copyright date to auto-update to the current year. Here’s the code for various programming languages:
Copyright © <?php date(“Y”); ?>
Note that capitalization DOES matter in PHP, and it does matter here. Be sure to use the capital Y to get the full four-digit year.
Copyright © <%= year(date) %>
Copyright © xxxx
var d=new Date();
And replace xxx with the first year your website was published.
Now if I could only get my computer to help me remember to write the correct year on my checks…