1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Automatic Copyright Dates

Automatically keep your copyright dates current on your website


Most websites include a copyright disclaimer at the bottom of the page. Having a copyright line that is out of date can be a bad reflection on your site. This little PHP script automatically changes the copyright to the current year every year so that it never goes out of date.
 $time = time () ; 
 //This line gets the current time off the server

 $year= date("Y",$time) . "<br>"; 
 //This line formats it to display just the year

 echo "Copyright 2002 - " . $year;
 //this line prints out the copyright date range, you need to edit 2002 to be your opening year
This code could be placed directly on the page, or could be held in a separate file and called with a file include.
  1. About.com
  2. Technology
  3. PHP / MySQL
  4. Step By Steps
  5. Automatic Copyright Dates - PHP Copyright Year Script

©2014 About.com. All rights reserved.