Return to Snippet

Revision: 61617
at December 28, 2012 09:44 by rumremix


Initial Code
© 2008-
<script>var tD = new Date();var datestr =  tD.getFullYear();document.write(datestr);</script>
 Name of Company

Initial URL


Initial Description
Often on a page footer, we want a copyright date range starting with the year the website was launched and ending the current year. Doing this dynamically means no need to update on 1/1 every year. The js snippet below uses the server date to accomplish this.

Initial Title
dynamic current year with JavaScript

Initial Tags
date

Initial Language
JavaScript