October CMS resources and help articles

Simple and to the point. Optimized by the community.

Display current year in Twig

13
by drmzio, last modified on August 12th, 2019

Showing the current year in Twig is easier than you'd think. Here's how to display the current year inside of your Twig templates.

{{ 'now' | date('Y') }}

You'll find this code snippet very useful when displaying your copyright in the footer of the website. (e.g. MyWebsite © 2019)

Discussion

0 comments

We use cookies to measure the performance of this website. Do you want to accept these cookies?