Duration
Duration is a fieldtype that allows you to store lengths of time.
note
The following examples use a field named duration_field
. This should be replaced with your field name.
- Twig
- Blade
{{ entry.duration_field }}
{{ $entry->duration_field }}
Parameters
Format
Similar to Date Variable Formatting, you can customize how you display the duration using a format= parameter. For example, 2:15:12 (8112 seconds) could also be displayed with:
- Twig
- Blade
{{ entry.duration_field.parameters({format: '%h hrs, %m min'}) }}
{{ $entry->duration_field->parameters(['format' => '%h hrs, %m min']) }}
info
See the ExpressionEngine Documentation for more information on the Duration fieldtype