Skip to content

Instantly share code, notes, and snippets.

@TravelingTechGuy
Last active January 2, 2016 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TravelingTechGuy/8224859 to your computer and use it in GitHub Desktop.
Save TravelingTechGuy/8224859 to your computer and use it in GitHub Desktop.
Add the current year to copyright notice/footer
<!-- Assuming you have the text &copy <span id="year"></span> in your footer -->
<!-- Without jQuery, add to bottom of page -->
<script>document.getElementById('year').textContent = (new Date()).getFullYear();</script>
<!-- If you're using jQuery, add this to $(document).ready() or $(function()) -->
$('#year').text((new Date()).getFullYear());
<!-- One line in the HTML page -->
<footer>copyright © <script>document.write((new Date()).getFullYear());</script></footer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment