Make Your Copyright Year Automatically Update

Autoupdating Copyright Year

At the time of writing, the year 2013 is quickly approaching. Many of us bloggers and website owners have a copyright date in our footer, and this is something that most of us update every year after New Years. Thankfully, there’s a way to update this automatically with a little snippet of PHP.

For WordPress users, this is quite simple. Simply replace your copyright year with this code:

<?php the_date('Y'); ?>

For all other website owners (provided you are running a PHP website), use this code:

<?php echo date('Y', time()); ?>

Those of you running HTML sites are going to have to go a little old school with some Javascript:

<script type="text/javascript">
var theDate=new Date()

Merry Christmas, and Happy New Year!


Copyright 2019, All rights reserved. Yadda yadda.