I have seen this done with PHP before and have done it myself with PHP. But I realized why not use JavaScript. It's very simple. (function (){ var date=new Date(); if(document.querySelector("#auto-year-update")!==null){ document.querySelector("#auto-year-update").innerText=date.getFullYear(); } })(); Code (JavaScript): With this code we would just need to replace the year 2019 with a <span id="auto-year-update"></span> which will then be populated with the current year.
The only disadvantage with doing it via JavaScript is your copyright holds little merit since the year is based on the clients computers date. However, nothing will probably ever come out of it.
Not sure why you want to do it this way. As @NetStar has noted it is probably a non-issue legally. No matter how you are building your pages, adding a copyright via the backend is super simple, so why not do it when you are building your pages? I build all of my pages using FoxPro and use the following snippet to generate the copyright notice: ******************** * * Insert copyright on page centering if needed * ******************** PARAMETERS qCenter DO CASE CASE gTest && Drops through if we are in test mode without adding copyright OTHERWISE \<BR> \ IF qCenter \<CENTER> \ ENDIF \<FONT SIZE='1' COLOR='blue'>All content copyright 1984-<<YEAR(DATE())>> by mmerlinn.</FONT> \ IF qCenter \</CENTER> \ ENDIF \<BR> \ ENDCASE RETURN Code (markup): Granted that code is not compatible with HTML5, but that would be easy to fix.