Me, Her, the Boy and a Dog

The adventures of me, her, my boy and our dog as we navigate life in a crazy world. We love the outdoors, sports, reading, playing, and of course, the Virginia Tech Hokies and the William & Mary Tribe.

Also, I founded the GoFightWinVT Tumblr, so if you're a Hokie, give it a follow. And, feel free to check out my Project 365 Tumblr.
Recent Tweets @vthokiefans
Who I Follow

If you develop or maintain Web sites, you probably get pretty tired of having to manually update the copyright years at the bottom of the page. Hopefully, you are using a javascript includes file so that you only need to update one file and not every page on your site. Been there and done that.

Now, to save you even more time and hassle, especially if you maintain a lot of Web sites, like I do, you can use the following code in place of the year in your footer code:

<script type=”text/javascript”>
now = new Date
theYear=now.getYear()
if (theYear < 1900)
theYear=theYear+1900
document.write(theYear)
</script>

So, your code would look like this:

Copyright &copy;

<script type=”text/javascript”>
now = new Date
theYear=now.getYear()
if (theYear < 1900)
theYear=theYear+1900
document.write(theYear)
</script>

<a href=”http://www.yourbusinessname.com” target=”_blank” title=”Check out my business Web site.”>YourBusinessName.com</a>

If you have questions or have built a better mouse trap for this issue, please let me know at gary.cope AT gmail DOT com.