Posted on March 15th, 2010 in Website Management & Improvement.
Tags: adding date to website, automatic updates, copyright date, php
In a previous post I wrote about a quick tip that you can do for updating your website in the new year by adding the current year in your footer copyright notice. Well, here’s a quick trick that will even save you that job, which is great if you have several websites to update or your website is pretty big.
It’s a simple piece of code that you can put in your footer that will take the year from the server and output it onto your website. As long as the server date is up to date you don’t have anything to do.
It took me ages to find this tiny piece of code to use myself and am now implementing it on the jaority of my websites.
<?php echo date(“Y”); ?>
It’s that simple. Just copy it into the bottom of your page where you have the copyright notice.
Not got a copyright notice? Try this:
<p>Copyright © <?php echo date(“Y”); ?> <a href=”http://www.websiteaddress.co.uk/”>Website Name</a>. All rights reserved.</p>
This should work on most hosting accounts, although if you have any trouble your hosting company should have some information on getting this to work it their FAQ, knowledgebase or by contacting their support.