1. Home
  2. Support
  3. Scripting
  4. Automatically update the copyright year

Automatically update the copyright year

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

Show current year in .NET

<%="&copy;" & DateTime.Now.Year %>

Show current year in ASP

<% response.write ("&copy;" & Year(Now)) %>

Show current year in JavaScript

<SCRIPT LANGUAGE="JavaScript">
today=new Date();
cy=today.getFullYear();
document.write(‘&copy;’ + cy);
</SCRIPT>

Show current year in PHP

&copy; <?=date("Y") ?>
Was this article helpful to you? 1 2

Last modified: 14/08/2019