Table of Contents

Date Filter

The date filter can be used to format date information into a human-readable format.

The date filter expects a timestamp value.

Example:

{$myTimestamp|date:"m-d-Y"}

If you have an SQL date value (i.e. YYYY-MM-DD) or datetime value instead, you can make use of the todate filter, which converts a date to a timestamp, which can then be formatted with the date filter:

Example:

{$myDate|todate|date:"d.m.Y."}

Another way to format dates is to use a custom DataSetDecorator.