Translate date

Define date formats for each language and easily use for dates in your templates

Check GitHub

Due to the nature of the plugin, there's no way to demo both basic and intl processors so here are some examples of the basic (default plugin config)

  • Config default
    {{ 'now'|td }}

    Output: 01/20/2025 10:57PM

  • Force language
    {{ 'now'|td('de') }}

    Output: 20.01.2025 22:57

  • Force format
    {{ 'now'|td(null, 'Y-m l') }}

    Output: 2025-01 Monday

  • Force both
    {{ 'now'|td('lt', 'Y-m l') }}

    Output: 2025-01 Pirmadienis

Same usage with intl support - only formats are different (see README)


Default config is:

enabled: true
processor: basic # `basic|intl`
formats:
  cs: 'd.m.Y H:i'
  de: 'd.m.Y H:i'
  en: 'm/d/Y h:iA'
  es: 'd/m/Y H:i'
  id: 'd/m/Y H:i'
  lt: 'Y-m-d H:i'