Update Your Copyright Year

No idea why I never did this before… I guess it boils down to being a big fat lazy head, and that – to me at least – it seems like such a minor little issue to just go change it when the new year rolls around.
However, I always forget to do it on some site or another. So, here’s the simple java script snippet to automatically update with the current year.

<script language=”javascript” type=”text/javascript”>
var today = new Date()
var year = today.getFullYear()

And here’s a simple PHP snippet:

<?php echo date(“Y”); ?>

For the PHP to work, you may need to add the following line to your .htaccess file.

AddType application/x-httpd-php .htm .html

Note: PHP will not work directly in Joomla content or modules. Luckily, there’s a nifty little non-commercial extension for that!

Thank you Access Communications

One Response to “Update Your Copyright Year”

Leave a Reply