Skip to content
Twig Field Finder
Theme

Smart Date — start / end

Fill in your field name

Italic values are placeholders: replace them with your own machine names, or let the builder do it.

Reads the entity directly, before field formatters run.

  1. Snippet 1
    {{ node.field_name.value|format_date('medium') }}
  2. Snippet 2
    {{ node.field_name.end_value|format_date('medium') }}
  3. Snippet 3
    {{ node.field_name.value|date('d.m.Y H:i', node.field_name.timezone ?: null) }}

Gotcha

Needs the Smart Date module. value and end_value are Unix timestamps. Each value can have its own timezone; when it’s empty, the site or user timezone applies.