Display current year in Twig
27
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)
There are no comments yet
Be the first one to comment