Automatic copyright updates

"The devil is in the details." One of my pet-peeves is an incorrect copyright date on a website. Is is critical, not at all. Is it s sign of the professionalism of the web designer, I think so, particularly when it is something that is so easy to add.

There are two ways to write it, either as javascript or as php. JavaScript would be used on a static site or CMS site. PHP could be used on a CMS site. The thing that's great about either method - you'll never have to worry about it again. The copyright date will automatically update to the new year, each year.

JavaScript:

<p>Copyright &copy;

<script type="text/javascript">
                    <!--
                        var currentTime = new Date()
                        var year = currentTime.getFullYear()
                        document.write(year)
                    //-->
                </script>

&nbsp; Your Company Name. All rights reserved.

</p>

Output: Copyright © 2013 Your Company Name. All rights reserved.

PHP

<p>Copyright &copy; <?php echo date('Y'); ?>. Your Company Name. All rights reserved.</p>

Output: Copyright © 2013 Your Company Name. All rights reserved.

Date information is not limited to a year. The code snippets for adding days, months, etc. to the copyright are readily available the Internet.

The dates shown is not dynamically generated for this example.

910-690-1179

Newsletter