How to auto-update your copyright year

Black and white image that says "how to auto-update your copyright year"

Nothing is more tell-tale about a site being old and out of date than a years-old copyright year in the footer of a website. Here’s how you can automatically update your copyright year as soon as the clock strikes 12 on New Year’s Eve.

Via PHP

<?php echo date("Y"); ?>

Via Javascript

<script type="text/javascript">
  document.write(new Date().getFullYear());
</script>

UpdateYourFooter.com has some great additional scripts you can use if you want something fancy!

Subscribe to Foundation!

Sign up now to get notifications when new posts are made including tips, tricks, tutorials, and more. You can unsubscribe at any time! I'll never sell or share your email address.