Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Duration: Difference between revisions

Template page
Tyraeis (talk | contribs)
m Remove some debugging text I accidentally left in
RA2lover (talk | contribs)
Add visual editor fields. Currently not working without module support, will add that in shortly.
Line 1: Line 1:
<includeonly>{{#invoke:Duration|fromSeconds|{{{seconds}}}}}</includeonly><noinclude>{{Documentation}}</noinclude>
<includeonly>{{#invoke:Duration|fromSeconds|{{{seconds}}}}}</includeonly><noinclude><templatedata>{
"description": "Convert a duration to a human-readable format.",
"params": {
"Seconds": {
"label": "Seconds",
"type": "number",
"required": false,
"suggested": false,
"description": "Seconds to add to the duration.",
            "aliases": [1]
},
"Minutes": {
"label": "Seconds",
"type": "number",
"required": false,
"suggested": false,
"description": "Minutes to add to the duration."
},
"Hours": {
"label": "Seconds",
"type": "number",
"required": false,
"suggested": false,
"description": "Hours to add to the duration."
},
"Days": {
"label": "Days",
"type": "number",
"required": false,
"suggested": false,
"description": "Days to add to the duration."
}
    }
}</templatedata>{{Documentation}}</noinclude>

Revision as of 04:43, 19 March 2026

Convert a duration to a human-readable format.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
SecondsSeconds 1

Seconds to add to the duration.

Numberoptional
SecondsMinutes

Minutes to add to the duration.

Numberoptional
SecondsHours

Hours to add to the duration.

Numberoptional
DaysDays

Days to add to the duration.

Numberoptional
Template documentation[view] [edit] [history] [purge]

This template converts a duration in seconds to a human-readable format that is broken up into hours, minutes, and seconds.

Usage

Use the Seconds, Minutes, Hours and Days parameters to set the duration.

Examples

Wikitext Renders as
{{Duration|seconds=4830}}
1 h 20 min 30 s
{{Duration|hours=2.5}}
2 h 30 min
{{Duration|seconds=7200}}
2 h
{{Duration|hours=2|seconds=30}}
2 h 30 s
{{Duration|seconds=333}}
5 min 33 s
{{Duration|seconds=120}}
2 min
{{Duration|seconds=42}}
42 s