:Duration

Terraria Wiki
둘러보기로 이동 검색으로 이동
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 틀:Duration/l10n for the localization of this template.
Template-info.svg Documentation The documentation below is transcluded from 틀: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 {{#[[[:틀:Tl/parser function links]]##expr 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 
{{duration|40.75}} 40.75 
{{duration|90}} 1 30 
{{duration|1800}} 30 0 
{{duration|7201}} 120 1 
{{duration|604800}} 10,080 0 
{{duration|604800|weeks}} 1 0 
{{duration|7201|weeks}} 2 1 
{{duration|604800|d}} 7 0 
{{duration|7201|w}} 2 1 
{{duration|1/3}} 0.33 
{{duration|1/3|round=6}} 0.333333 
{{duration|(35/11 mod 2) - (10^-2 / pi*3) + ceil(21/6)}} 4.99 
{{duration|{{#[[[:틀:Tl/parser function links]]##time time]:U|+3 days 2 hours 44 minutes 23 seconds}}-{{#time:U}}|days}} 3 2 44 23 
{{duration|{{#time:U|+2 days 37 hours 98 minutes 63 seconds}}-{{#time:U}}|hours}} 86 39 3 
{{duration|-41}} −41 
{{duration|-3601|days}} −1 1 
{{duration|0}}
{{duration|0.001}}
{{duration|-0.001}} −0 
{{duration|0.001|round=5}} 0.001