Kick your footer into gear with a dynamic copyright

Year after year we end up changing copyright footers. Here are some snippets that will automatically update the year in your copyright text.

Django:
{% now "Y" %}
Ruby on Rails:
<%= Time.now.year %>
PHP:
<?php echo date('Y'); ?>
Smarty:
{$smarty.now|date_format:"%Y"}
JavaScript:
<script type="text/javascript">
   
 document.write(new Date().getFullYear()); 
</script>


ai,code,copyright,footer

Technology

Leave a Comment

* = required