Simple PHP to Keep Year up to Date

Whats the simple PHP code to keep the Year in the Copyright up to date?

Example:Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved

What would I need so 2009 is updated to the current year so after new years it updates itself?

You could use date(‘Y’)

Remember that the years noted in the copyright line pertain to the period under which the “work” (the thing you’re claiming copyright on) was created. If it comes to January 1st and nothing in the work has changed, it is not correct to change the copyright line.

So an even better solution would be to get the date of the most recent content?

What I have been using to get the current year is:

<?php
$date = getdate();
echo $date['year'];
?>

What would be the method to get the date of the most recent content?

Since some of the rendered pages I use are created using PHP, would it all be recent? What about a page that is totally PHP?

That all depends on how your provide the content. Is it stored in a database? Is it stored in a separate file? Is the content in the same PHP file?

It all depends.

Some websites are static. I edit the html and write the content.

I working on a site using a MySQL database, so if information is added to the database, the page that displays this information will change. There is also a page that creates a list of files in a specific directory.

I have started a site that may end up being a Wordpress site.

I would guess that each of these may use a different method for determining the correct copyright date.