pub fn date(val: &Value, kwargs: Kwargs, _: &State<'_>) -> TeraResult<String>Expand description
Formats the given value using the given format if it can be parsed as a date/datetime. Takes:
- optional
formatargument, defaulting to%Y-%m-%d - optional
timezoneargument, defaulting to not set
{{ value | date }}
{{ value | date(format="%B %d, %Y") }}
{{ timestamp | date(format="%Y-%m-%d %H:%M", timezone="Europe/Paris") }}