Contents

Usage

Unformatted input

An unformatted duration can be input in the first parameter: {{Duration|10:20:30}} (hours:minutes:seconds) or {{Duration|20:30}} (minutes:seconds). There must be a seconds value, as inputs in hours and minutes are indistinguishable from inputs in minutes and seconds.

Numbered parameters

{{Duration|10|20|30}}

where parameters are hours, minutes and seconds respectively. If the hours or minutes values are zero, then leave them blank (e.g. {{Duration||20|30}}). Minutes and seconds values default to zero, although they should ideally be specified.

h, m and s parameters

{{Duration|h=10|m=20|s=30}}

where h, m and s are hours, minutes and seconds respectively. Minutes and seconds values default to zero, although they should ideally be specified.

N{{Duration|h=1|m=22|s=78}} renders as:Error in Module:Hms: Seconds value must be less than 60

N{{Duration|h=1.1|m=2.2}} renders as:Error in Module:Hms: Hours and minutes values must be integers

Numbered parameters

{{Duration|1|22|34}} renders as: 1:22:34

{{Duration||74|32}} renders as: 74:32

{{Duration|1|2|34}} renders as: 1:02:34

{{Duration|1|2|3}} renders as: 1:02:03

{{Duration|0|22|34}} renders as: 0:22:34

{{Duration|0|0|34}} renders as: 0:00:34

{{Duration||0|34}} renders as: 0:34

{{Duration|||34}} renders as: 0:34

{{Duration|1|22|34.5678}} renders as: 1:22:34.5678

{{Duration||1|22}} renders as: 1:22

{{Duration|1|22}} renders as: 1:22:00

{{Duration|1|22|0}} renders as: 1:22:00

N{{Duration|1|22|}} renders as: 1:22:00

{{Duration|0|0|0}} renders as: (blank)

{{Duration|||}} renders as: (blank)

N{{Duration|1|22|34|55}} renders as:Error in Module:Hms: Parameter number 4 should not be specified

N{{Duration|one|22|0}} renders as:Error in Module:Hms: Invalid values

N{{Duration|1|22|78}} renders as:Error in Module:Hms: Seconds value must be less than 60

N{{Duration|1.1|2.2}} renders as:Error in Module:Hms: Hours and minutes values must be integers

Microformat

The HTML mark-up produced by this template includes HTML classes intended to be part of an hAudio microformat that makes an audio recording's details readily parsable by computer programs. This aids tasks such as the cataloguing of articles and maintenance of databases. For more information about the use of microformats on Wikipedia, please visit the Microformat WikiProject.