drupal 8

3 easy ways to print current year in Drupal templates

We've all built them about a hundred times, those copyright lines with the year in the footer.  Here's a few ways to print those with the current year generated, along with any drawbacks involved (looking at you Javascript!).


print date('Y');




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