Difference between revisions of "Template:ExpandTime"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (*work with exact 1 day, 1 hours, 1 minute)
Line 1: Line 1:
<includeonly>{{#ifexpr: {{{1}}} >= 86400|{{formatnum: {{#expr: trunc({{{1}}} / 86400)}}}} d|}} {{#ifexpr: {{{1}}} >= 3600|{{#expr: {{{1}}} / 3600 mod 24}} h|}} {{#ifexpr: {{{1}}} >= 60|{{#expr: {{{1}}} / 60 mod 60}} m|}} {{#expr: {{{1}}} mod 60}} s</includeonly>
+
<includeonly>{{#ifexpr: {{{1}}} >= 86400|{{formatnum: {{#expr: trunc({{{1}}} / 86400)}}}} d|}} {{#ifexpr: {{{1}}} >= 3600|{{#expr: {{{1}}} / 3600 mod 24}} h|}} {{#ifexpr: {{{1}}} >= 60|{{#expr: {{{1}}} / 60 mod 60}} m|}} {{#expr: {{{1}}} mod 60 + {{{1}}} - trunc({{{1}}}) round 1}} s</includeonly>
 
<noinclude>{| class="wikitable"
 
<noinclude>{| class="wikitable"
 
! #
 
! #

Revision as of 23:47, 19 February 2013

# Description
1 Time in seconds

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

Example

{{ExpandTime|9203544.6}}

426 d 0 h 32 m 24.6 s