a Sensio Labs Product

The flexible, fast, and secure
template engine for PHP

Questions & Feedback

License

Twig documentation is licensed under the new BSD license.

The Intl Extension

The Intl extensions provides the localizeddate filter.

localizeddate

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

1
{{ 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.

Note

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

Arguments

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