In software engineering, it often said that, once the task is repetitive🙄, automate it! So must the © Copyright Date on the footer be automated.
Footer holds details such as Sitemap, Social Links and Copyright Notice of a site.
- Add the JS script to your HTML
- Introduce a script tag in your Footer Section.
<p> © <script> document.write(new Date().getFullYear()); </script> <a href='https://twiter.com/saviour123>Saviour Gidi<a/> </p>
© 2019 Saviour Gidi
Introduce a script tag with AJAX and get the current Date from World Clock.
<p> © <p id='copyright'></p> Saviour Gidi </p> <script> fetch('http://worldclockapi.com/api/json/utc/now') .then(data => data.json()) .then(d => document.getElementById('copyright').innerHTML = (new Date(d.currentDateTime).getFullYear()) ) </script>
NB: This second approach is to a response in the comments.
Imagine every year you have to manually change the date on the website. It's not safe for your health and your company's and I pity you🤣. To cut long story short, update your code to include the JS tag!