a Sensio Labs Product

The flexible, fast, and secure
template engine for PHP

Questions & Feedback


Twig documentation is licensed under the new BSD license.

The Intl Extension

The Intl extensions provides the localizeddate filter.


Use the localizeddate filter to format dates into a localized string representating the date.

{{ post.published_at|localizeddate('medium', 'none', locale) }}

The localizeddate filter accepts strings (it must be in a format supported by the strtotime function), DateTime instances, or Unix timestamps.


Internally, Twig uses the PHP IntlDateFormatter::create() function for the date.


This website is powered by PHP and Twig. The Twig logo is © 2010-2012 Sensio Labs