1. Home
  2. Scripting
  3. 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") ?>
Click here for full details

Classification: Public
Last saved: 2019/08/14 at 14:26 by Jamie

How can we help?