JavaScript Snippets

This is pure JavaScript, meaning it will refresh the year browser-side, depending on the user's time settings. Just copy the below snippet and paste it where you want your dynamic text in the footer to appear.

<script type="text/javascript"> document.write(new Date().getFullYear()); </script>

This will just give you:

If you want a bit more information, here's a snippet you can customize:

© 2010<script>new Date().getFullYear()>2010&&document.write("-"+new Date().getFullYear());</script>, Company.

Which will give you:

© 2010 , Company.

Because JavaScript works on the client (the user's browser, that is), it is dependent on the user's settings. In most cases it will likely be what you'd expect. Here's more info on the JavaScript Date Object.

You can even install the Node package 'rainge' for having a truly automated way to keep your date stamps updated – you just set the year once, and rainge does the rest.