RSSAmplifier

Chris Otto | Father, Developer, SDET · Nov 20, 2018

Dynamically Set Footer Copyright Date

0
Sign in to vote or save

Chris Otto | Father, Developer, SDET

Published on

Authors

two thousand nineteen

Table of Contents

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>

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

Read the original on chrisotto.dev

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.