Skip to content
Zotonic
  • Start
  • Cookbook
  • Reference
  • Releases

Live search

Search across all Zotonic content

Type at least two characters

Results are matched against titles, summaries and topics as you type.

Filters ยท mod_base
  • Reference
  • Frontend developer
  • Template filter
  • Format
  • Duration

format_duration

Module

mod_base

Show a duration in hours, minutes and seconds.

Takes as input a number representing a number of seconds. Outputs a human readable form.

For example:

{{ 123|format_duration }}

Will ouput 2m3s.

And:

{{ 3601|format_duration }}

Will ouput 1h0m1s.

Edit on GitHub

Related pages

  • format_number Show an integer or float. โ†’
  • format_integer Show an integer value. โ†’
  • format_price Show a price with decimals. โ†’

Related documentation

Filters

timesince

Show a readable version of a date/time difference.

Filters

filter_payment_currency_symbol

Show a payment currency using its preferred symbol or short form.

Filters

humanize_identifier

Convert an underscore-separated identifier to a readable label.

Filters

media_exif_value

Formats EXIF values for display in templates.

Filters

format_dispatch_path_element

Format dispatch path element so variables will be more visible.

Filters

format_dispatch_controller_option

Format dispatch controller options.

Filters

upper

Translates the value to upper case.

Filters

date

Formats a date or datetime according to the format specified in the argument.

Filters

language_dir

Return rtl or ltr depening on the direction of the language.

GitHub © 2026 Zotonic