auto update copyright year html
snippet in html

auto update copyright year html

user134

<div class="copyright">
  <footer>Copyright © <span id="year"></span> , All rights reserved to X</footer>
</div>
<script>
  
  function getCurrentYear() {
    return new Date().getFullYear(); // returns the year via local timing
  };

  document.getElementById("year").innerHTML = getCurrentYear(); 
  //changing the inner html of the span with "year" id to the given year(2021)
</script>

automatic get year for copyright html

user9924

<script type="text/JavaScript"> var theDate=new Date() document.write(theDate.getFullYear()) </script>

automatic get year for copyright html

user8553

©<? echo date(Y);?>