Display a copyright year (or range) I have an old php code in the footer of my site like below. Will like to convert that to twig (which I suspect will be cleaner). I don't know a lick of php hence my question here.

&lt;p&gt;
    &lt;?
      $startyear = 2010;
      $currentyear = date("Y");

      if ($startyear == $currentyear)
   {
      echo "&amp;copy; $startyear Site Name. All Rights Reserved\n";

      }
  else
   {
     echo "&amp;copy; $startyear - $currentyear Sitename. All Rights Reserved\n";

    }
      ?&gt; 
&lt;/p&gt;
You can use Twig's date filter:

{{ "now"|date('Y') }} Sitename. All rights reserved.


More info in the Twig docs