Skip to content

Instantly share code, notes, and snippets.

@gwagroves
Created October 22, 2016 08:00
Show Gist options
  • Save gwagroves/508913e40961eaaffa5aac9195279131 to your computer and use it in GitHub Desktop.
Save gwagroves/508913e40961eaaffa5aac9195279131 to your computer and use it in GitHub Desktop.
Drupal 8: Show formatted node created data in Twig
{# html_date is the machine name of an existing date format #}
{% set createdDate = node.getCreatedTime|format_date('html_date') %}
<div class="date">{{ createdDate }}</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment