Skip to main content

date

Function date 

Source
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:

  1. optional format argument, defaulting to %Y-%m-%d
  2. optional timezone argument, defaulting to not set
{{ value | date }}
{{ value | date(format="%B %d, %Y") }}
{{ timestamp | date(format="%Y-%m-%d %H:%M", timezone="Europe/Paris") }}