# String & Date Filters URL: /docs/reference/template-functions/string-date-filters/ Section: template-functions Tags: reference, filters, strings, dates -------------------------------------------------------------------------------- String Filters word_count Count words in text, stripping HTML first. Uses same logic as reading_time. {{ page.content | word_count }} words {# Combined with reading time #} <span>{{ page.content | word_count }} words ยท {{ page.content | reading_time }} min read</span> Also available as wordcount (Jinja naming convention). Date Filters These filters help calculate and display content age and date information. days_ago Calculate days since a date. Useful for freshness indicators. {# Days since publication #} {{ page.date | days_ago }} days old {# Conditional styling #} {% if page.date | days_ago < 7 %} <span class="badge badge-new">New</span> {% end %} months_ago Calculate calendar months since a date. {% if page.date | months_ago > 6 %} <div class="notice">This content may be outdated.</div> {% end %} month_name Get month name from number (1-12). {{ 3 | month_name }} {# โ†’ "March" #} {{ 3 | month_name(true) }} {# โ†’ "Mar" (abbreviated) #} {# With date #} {{ page.date.month | month_name }} humanize_days Convert day count to human-readable relative time. {{ page.date | days_ago | humanize_days }} {# โ†’ "today", "yesterday", "3 days ago", "2 weeks ago", etc. #} -------------------------------------------------------------------------------- Metadata: - Author: lbliii - Word Count: 187 - Reading Time: 1 minutes