Hosting

  1. Home
  2. Support
  3. Hosting
  4. PHP
  5. Automatically update the copyright year

Automatically update the copyright year

If your website is still showing © 2023 and it should be © 2024 then take the opportunity to update once and have it correct forever using one of the code snippets below:

Show current year in PHP

&copy; <?=date("Y") ?>

Show current year in JavaScript

<SCRIPT LANGUAGE="JavaScript">
today=new Date();
cy=today.getFullYear();
document.write(‘&copy;’ + cy);
</SCRIPT>
Was this article helpful to you? Yes No
Click here for full details