date_format

Formats a date to a given named date format.

Specification

{{ date | date_format: format }}

Parameter Description Example Values
date (required) The date that you require to be formatted. account.created_at
format The named formatter. See named formats table below
Named Format Example output
db 2008-12-25 14:35:05
number 20081225143505
time 14:35
short 25 Dec 14:35
long December 25, 2008 14:35
long_ordinal December 25th, 2008 14:35
rfc822 Thu, 25 Dec 2008 14:35:05 +0000
std_date “%Y-%m-%d”
long_date “%B %e, %Y”
military “%Y-%m-%dT%H:%M:%S%Z”
weekday “%A %B %e, %Y”
editorial “%l:%M %p on %B %e, %Y”
editorial_at “%B %e, %Y at %l:%M %p”

Examples

{{ account.created_at | date_format: 'editorial_at' }}