DEV Community

Chris Otto
Chris Otto

Posted on • Originally published at chrisotto.dev on

4 1

Dynamically Set Footer Copyright Date

With 2018 winding down I found myself thinking that I will need to leave a note to update the footer on my site to change the year to 2019. Having to come back year after year to statically change the copyright year in my footer is something I will no longer do. So why not have it set dynamically?

<script>
  document.write(new Date().getFullYear())
</script>
Enter fullscreen mode Exit fullscreen mode

Instead of just adding the year I also included a copyright character and my name wrapping the new script.

©
<script>
  document.write(new Date().getFullYear())
</script>
Chris Otto
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay