Terraria Wiki

Miss the old Hydra Skin? Try out our Hydralize gadget! Visit the preferences page while logged in and turn on the gadget.

READ MORE

Terraria Wiki
Advertisement
This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for templates to learn more.
See Template:Duration/l10n for the localization of this template.
Template-info.svg Documentation The documentation below is transcluded from Template:Duration/doc. (edit | history)

Format a time value, input in seconds.

Usage

{{ duration | <time in seconds> | <maximum unit> | round = <rounding level> }}

First unnamed parameter

Number, time in seconds. Any valid {{#expr:}} string is accepted.

Second unnamed parameter

Greatest unit of the output. Can be any of seconds, minutes (default), hours, days, and weeks, or s, m, h, d, and w for short, respectively.

round

Rounding level for decimal seconds, 2 by default.

Examples

Code Result
{{duration|41}} 41 seconds
{{duration|40.75}} 40.75 seconds
{{duration|90}} 1 minute 30 seconds
{{duration|1800}} 30 minutes
{{duration|7201}} 120 minutes 1 second
{{duration|604800}} 10,080 minutes
{{duration|604800|weeks}} 1 week
{{duration|7201|weeks}} 2 hours 1 second
{{duration|604800|d}} 7 days
{{duration|7201|w}} 2 hours 1 second
{{duration|1/3}} 0.33 seconds
{{duration|1/3|round=6}} 0.333333 seconds
{{duration|(35/11 mod 2) - (10^-2 / pi*3) + ceil(21/6)}} 4.99 seconds
{{duration|{{#time:U|+3 days 2 hours 44 minutes 23 seconds}}-{{#time:U}}|days}} 3 days 2 hours 44 minutes 23 seconds
{{duration|{{#time:U|+2 days 37 hours 98 minutes 63 seconds}}-{{#time:U}}|hours}} 86 hours 39 minutes 3 seconds
{{duration|-41}} −41 seconds
{{duration|-3601|days}} −1 hour 1 second
{{duration|0}} 0 seconds
{{duration|0.001}} 0 seconds
{{duration|-0.001}} −0 seconds
{{duration|0.001|round=5}} 0.001 seconds
Advertisement