Jump to content

Template:Human readable duration/testcases

From Wikipedia, the free encyclopedia


No parameters
  • {{Human readable duration}}Human readable duration error: First argument must be a positive number (help)
  • {{Human readable duration/sandbox}}Human readable duration error: First argument must be a positive number (help)


Missing second parameter
  • {{Human readable duration|5}}Human readable duration error: Second argument must be a valid time unit (help)
  • {{Human readable duration/sandbox|5}}Human readable duration error: Second argument must be a valid time unit (help)


Bad first parameter
  • {{Human readable duration||seconds}}Human readable duration error: First argument must be a positive number (help)
  • {{Human readable duration/sandbox||seconds}}Human readable duration error: First argument must be a positive number (help)
  • {{Human readable duration|yes|seconds}}Human readable duration error: First argument must be a positive number (help)
  • {{Human readable duration/sandbox|yes|seconds}}Human readable duration error: First argument must be a positive number (help)
  • {{Human readable duration|-5|seconds}}Human readable duration error: First argument must be a positive number (help)
  • {{Human readable duration/sandbox|-5|seconds}}Human readable duration error: First argument must be a positive number (help)


Bad second parameter
  • {{Human readable duration|5|}}Human readable duration error: Second argument must be a valid time unit (help)
  • {{Human readable duration/sandbox|5|}}Human readable duration error: Second argument must be a valid time unit (help)
  • {{Human readable duration|5|yes}}Human readable duration error: Second argument must be a valid time unit (help)
  • {{Human readable duration/sandbox|5|yes}}Human readable duration error: Second argument must be a valid time unit (help)


Zero
  • {{Human readable duration|0|seconds}} → 0 seconds
  • {{Human readable duration/sandbox|0|seconds}} → 0 seconds
  • {{Human readable duration|0|minutes}} → 0 seconds
  • {{Human readable duration/sandbox|0|minutes}} → 0 seconds
  • {{Human readable duration|0|hours}} → 0 seconds
  • {{Human readable duration/sandbox|0|hours}} → 0 seconds
  • {{Human readable duration|0|days}} → 0 seconds
  • {{Human readable duration/sandbox|0|days}} → 0 seconds
  • {{Human readable duration|0|months}} → 0 seconds
  • {{Human readable duration/sandbox|0|months}} → 0 seconds
  • {{Human readable duration|0|years}} → 0 seconds
  • {{Human readable duration/sandbox|0|years}} → 0 seconds


Nearly zero
  • {{Human readable duration|0.1|seconds}} → 0 seconds
  • {{Human readable duration/sandbox|0.1|seconds}} → 0 seconds
  • {{Human readable duration|0.1|minutes}} → 6 seconds
  • {{Human readable duration/sandbox|0.1|minutes}} → 6 seconds
  • {{Human readable duration|0.1|hours}} → 6 minutes
  • {{Human readable duration/sandbox|0.1|hours}} → 6 minutes
  • {{Human readable duration|0.1|days}} → 2.5 hours
  • {{Human readable duration/sandbox|0.1|days}} → 2.5 hours
  • {{Human readable duration|0.1|months}} → 3 days
  • {{Human readable duration/sandbox|0.1|months}} → 3 days
  • {{Human readable duration|0.1|years}} → 36.5 days
  • {{Human readable duration/sandbox|0.1|years}} → 36.5 days


Special exceptions
  • {{Human readable duration|24|hours}} → 1 day
  • {{Human readable duration/sandbox|24|hours}} → 1 day
  • {{Human readable duration|48|hours}} → 2 days
  • {{Human readable duration/sandbox|48|hours}} → 2 days


Good values already
  • {{Human readable duration|1|seconds}} → 1 second
  • {{Human readable duration/sandbox|1|seconds}} → 1 second
  • {{Human readable duration|1|minutes}} → 1 minute
  • {{Human readable duration/sandbox|1|minutes}} → 1 minute
  • {{Human readable duration|1|hours}} → 1 hour
  • {{Human readable duration/sandbox|1|hours}} → 1 hour
  • {{Human readable duration|1|days}} → 1 day
  • {{Human readable duration/sandbox|1|days}} → 1 day
  • {{Human readable duration|6|months}} → 6 months
  • {{Human readable duration/sandbox|6|months}} → 6 months
  • {{Human readable duration|2|years}} → 2 years
  • {{Human readable duration/sandbox|2|years}} → 2 years


Edges of conversions
  • {{Human readable duration|59.74|seconds}} → 59.5 seconds
  • {{Human readable duration/sandbox|59.74|seconds}} → 59.5 seconds
  • {{Human readable duration|59.75|seconds}} → 1 minute
  • {{Human readable duration/sandbox|59.75|seconds}} → 1 minute


  • {{Human readable duration|59.74|minutes}} → 59.5 minutes
  • {{Human readable duration/sandbox|59.74|minutes}} → 59.5 minutes
  • {{Human readable duration|59.75|minutes}} → 1 hour
  • {{Human readable duration/sandbox|59.75|minutes}} → 1 hour


  • {{Human readable duration|71.74|hours}} → 71.5 hours
  • {{Human readable duration/sandbox|71.74|hours}} → 71.5 hours
  • {{Human readable duration|71.75|hours}} → 3 days
  • {{Human readable duration/sandbox|71.75|hours}} → 3 days


  • {{Human readable duration|50.24|days}} → 50 days
  • {{Human readable duration/sandbox|50.24|days}} → 50 days
  • {{Human readable duration|50.25|days}} → 2 months
  • {{Human readable duration/sandbox|50.25|days}} → 2 months


  • {{Human readable duration|18.49|months}} → 18 months
  • {{Human readable duration/sandbox|18.49|months}} → 18 months
  • {{Human readable duration|18.50|months}} → 1.5 years
  • {{Human readable duration/sandbox|18.50|months}} → 1.5 years


Random typical values
  • {{Human readable duration|2880|hours}} → 4 months
  • {{Human readable duration/sandbox|2880|hours}} → 4 months
  • {{Human readable duration|100|days}} → 3 months
  • {{Human readable duration/sandbox|100|days}} → 3 months
  • {{Human readable duration|10000|months}} → 833.5 years
  • {{Human readable duration/sandbox|10000|months}} → 833.5 years
  • {{Human readable duration|30|seconds}} → 30 seconds
  • {{Human readable duration/sandbox|30|seconds}} → 30 seconds
  • {{Human readable duration|100000|seconds}} → 28 hours
  • {{Human readable duration/sandbox|100000|seconds}} → 28 hours