Skip to main content

Duration

Formats a duration in seconds as a human-readable string with localized units.

Default

Preview
Config
Value (seconds)

Duration in seconds.

Precision

Smallest unit to show, or auto.

Max Precision

Largest unit to show.

Pad

Pad values to fixed length.

Show Zero Parts

Show zero-value parts.

Precision: Minutes

[precision="minutes"]

Preview

Precision: Auto

[precision="auto"]

Preview

Padding

[pad="true"]

Preview

Show Zero Parts

[show-zero-parts="true"]

Preview

API

AttributeTypeDefaultDescription
valuenumberRequired. Duration in seconds.
precisionseconds | minutes | hours | days | autosecondsSmallest unit to show. auto shows the highest non-zero unit and the next.
max-precisionmilliseconds | seconds | minutes | hours | daysdaysLargest unit to show.
padbooleanfalsePad values to fixed length.
show-zero-partsbooleanfalseShow zero-value parts. Last part is always shown even if zero.