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

Template:ExpandTime: Difference between revisions

Template page
(importing functional ExpandTime template)
Tag: 2017 source edit
 
(implemented Template Data)
Tag: 2017 source edit
 
Line 1: Line 1:
<includeonly>{{#ifexpr: {{{1}}} >= 21600|{{#number_format: {{#expr: trunc({{{1}}} / 21600)}} }}&nbsp;<abbr title="Kerbin days (= 6 h)">d</abbr>|}} {{#ifexpr: {{{1}}} >= 3600|{{#expr: {{{1}}} / 3600 mod 6}}&nbsp;h|}} {{#ifexpr: {{{1}}} >= 60|{{#expr: {{{1}}} / 60 mod 60}}&nbsp;m|}} {{#expr: {{{1}}} mod 60 + {{{1}}} - trunc({{{1}}}) round 1}}&nbsp;s</includeonly><noinclude>{| class="wikitable"
<includeonly>{{#ifexpr: {{{1}}} >= 21600|{{#number_format: {{#expr: trunc({{{1}}} / 21600)}} }}&nbsp;<abbr title="Kerbin days (= 6 h)">d</abbr>|}} {{#ifexpr: {{{1}}} >= 3600|{{#expr: {{{1}}} / 3600 mod 6}}&nbsp;h|}} {{#ifexpr: {{{1}}} >= 60|{{#expr: {{{1}}} / 60 mod 60}}&nbsp;m|}} {{#expr: {{{1}}} mod 60 + {{{1}}} - trunc({{{1}}}) round 1}}&nbsp;s</includeonly><noinclude>
! #
<templatedata>
! Description
{
|-
"params": {
| 1
"1": {
| Time in seconds
"aliases": [
|}
"time",
"seconds"
],
"label": "Time",
"description": "Time (in seconds)",
"type": "number",
"required": true
}
}
}
</templatedata>


This template converts a time given in seconds into multiple different time units (days, hours, minutes and seconds), where:
This template converts a time given in seconds into multiple different time units (days, hours, minutes and seconds), where:
Line 12: Line 22:
* 1 day = 6 hours = 360 minutes = 21600 seconds
* 1 day = 6 hours = 360 minutes = 21600 seconds


It uses Kerbin's sidereal days as this is the time unit shown on the UI.
It uses Kerbin's sidereal days, the measure of time used in-game on the UI.


== Example ==
== Example ==

Latest revision as of 04:43, 2 January 2025

No description.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Time1 time seconds

Time (in seconds)

Numberrequired

This template converts a time given in seconds into multiple different time units (days, hours, minutes and seconds), where:

  • 1 minute = 60 seconds
  • 1 hour = 60 minutes = 3600 seconds
  • 1 day = 6 hours = 360 minutes = 21600 seconds

It uses Kerbin's sidereal days, the measure of time used in-game on the UI.

Example[edit source]

{{ExpandTime|9203544.6}}

426 d 0 h 32 m 24.6 s

Contents
MediaWiki Appliance - Powered by TurnKey Linux