flask_extras/macros/dates.html
{%- macro simpledatetime(timestr) %}
{% set t = timestr|str2dt %}
{% if t %}{{ t.strftime('%Y-%m-%d %H:%M:%S') }}{% else %}{{ t }}{% endif %}
{% endmacro -%}
{%- macro simpledate(timestr) %}
{% set t = timestr|str2dt %}
{% if t %}{{ t.strftime('%Y-%m-%d') }}{% else %}{{ t }}{% endif %}
{% endmacro -%}