django template tag to display current year

To display the current year using Django template tag, follow these steps:

  1. In the Django template file, add the following import at the top: {% load tz %}

  2. Then, use the following code to display the current year: {{ value|date:"Y" }}

  3. The "value" represents the current date and time, and the "|date:"Y"" filter formats it to display the current year.