Modèle:Duration
Aller à la navigation
Aller à la recherche
Documentation La documentation ci-dessous est transcluse de Modèle:Duration/doc. (modifier | historique)
[purger]
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
(default), minutes
, hours
, and days
, or weeks
, s
, m
, h
, and d
for short, respectively.
w
- round
Rounding level for decimal seconds,
by default.
2
Examples
Code | Result |
---|---|
{{duration|41}} |
41 secondes |
{{duration|40.75}} |
40,75 secondes |
{{duration|90}} |
1 minute 30 secondes |
{{duration|1800}} |
30 minutes |
{{duration|7201}} |
120 minutes 1 seconde |
{{duration|604800}} |
10 080 minutes |
{{duration|604800|weeks}} |
1 semaine |
{{duration|7201|weeks}} |
2 heures 1 seconde |
{{duration|604800|d}} |
7 jours |
{{duration|7201|w}} |
2 heures 1 seconde |
{{duration|2/3}} |
0,67 seconde |
{{duration|2/3|round=6}} |
0,666667 seconde |
{{duration|(35/11 mod 2) - (10^-2 / pi*3) + ceil(21/6)}} |
4,99 secondes |
{{duration|{{#time:U|+3 days 2 hours 44 minutes 23 seconds}}-{{#time:U}}|days}} |
3 jours 2 heures 44 minutes 24 secondes |
{{duration|{{#time:U|+2 days 37 hours 98 minutes 63 seconds}}-{{#time:U}}|hours}} |
86 heures 39 minutes 4 secondes |
{{duration|-41}} |
−41 secondes |
{{duration|-3601|days}} |
−1 heure 1 seconde |
{{duration|0}} |
0 seconde |
{{duration|0.001}} |
0 seconde |
{{duration|-0.001}} |
−0 seconde |
{{duration|0.001|round=5}} |
0,001 seconde |