Skip to content

Instantly share code, notes, and snippets.

@longjasonm
Created January 28, 2013 19:01
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 longjasonm/4658095 to your computer and use it in GitHub Desktop.
Save longjasonm/4658095 to your computer and use it in GitHub Desktop.
Shortest way to print current year in Javascript; for use in web pages footers. Source: http://stackoverflow.com/questions/4562587/shortest-way-to-print-current-year-in-javascript
<script>document.write(new Date().getFullYear())</script>
<!-- Example Code -->
<span>&copy; 2000&ndash;<script>document.write(new Date().getFullYear())</script> Your Company Name</span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment