date
Formats a date string into the specified pattern.
Built-in date format types:
- default
- abbreviated_date
- basic
- date
- date_at_time
- on_date
Custom date formats can be defined using placeholders. Reference: https://www.strfti.me/
date_string | date(format=format) returns [string]
Params
-
date_stringstring: Date string in ISO8601 format.
Hash Params
-
formatstring: Output format (supports built-in types or custom placeholders).
Example
{{ "2022-04-14 16:56:02 -0400" | date() }}
{{ "2022-04-14 16:56:02 -0400" | date(format="basic") }}
{{ "2022-04-14 16:56:02 -0400" | date(format="%B %d, %Y") }}
Was this article helpful to you?