此頁面為 Module:Duration 的說明文件

The module is meant for language-dependant time calculations.

It exports a single function: sumHMS, which accepts unnamed (aka "order based") arguments in the form ssss (any number of digits) or "mm:ss" or "hh:mm:ss:, sums up all the periods, and returns the output string describing the total duration.

An optional paramter, "units" controls the format of the output.

例子

編輯
  • {{#invoke:Duration | sumHMS | 7211 | units = minutes, seconds}}得到「120分11秒」。
  • {{#invoke:Duration |sumHMS | 1:0:11 | 1:00:00 | units= seconds}}得到「7,211秒」。
  • {{#invoke:Duration | sumHMS | 10:10:10 | 20:20:20 | 12:13:14 }}得到「1天18小時43分44秒」。