<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.badwolfmc.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AHuman_readable_duration</id>
	<title>Module:Human readable duration - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.badwolfmc.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AHuman_readable_duration"/>
	<link rel="alternate" type="text/html" href="https://wiki.badwolfmc.com/w/index.php?title=Module:Human_readable_duration&amp;action=history"/>
	<updated>2026-05-07T22:39:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.badwolfmc.com/w/index.php?title=Module:Human_readable_duration&amp;diff=5869&amp;oldid=prev</id>
		<title>Merc: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.badwolfmc.com/w/index.php?title=Module:Human_readable_duration&amp;diff=5869&amp;oldid=prev"/>
		<updated>2025-05-04T08:33:13Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:33, 4 May 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Merc</name></author>
	</entry>
	<entry>
		<id>https://wiki.badwolfmc.com/w/index.php?title=Module:Human_readable_duration&amp;diff=5868&amp;oldid=prev</id>
		<title>wikipedia&gt;MusikBot II: Protected &quot;Module:Human readable duration&quot;: High-risk template or module: 18524 transclusions (more info) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://wiki.badwolfmc.com/w/index.php?title=Module:Human_readable_duration&amp;diff=5868&amp;oldid=prev"/>
		<updated>2024-11-17T18:00:30Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/wiki/Module:Human_readable_duration&quot; title=&quot;Module:Human readable duration&quot;&gt;Module:Human readable duration&lt;/a&gt;&amp;quot;: &lt;a href=&quot;https://en.wikipedia.org/wiki/High-risk_templates&quot; class=&quot;extiw&quot; title=&quot;wikipedia:High-risk templates&quot;&gt;High-risk template or module&lt;/a&gt;: 18524 transclusions (&lt;a href=&quot;/w/index.php?title=User:MusikBot_II/TemplateProtector&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:MusikBot II/TemplateProtector (page does not exist)&quot;&gt;more info&lt;/a&gt;) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
-- reproduced from Module:Convert&lt;br /&gt;
local scale = {&lt;br /&gt;
	second = 1,&lt;br /&gt;
	seconds = 1,&lt;br /&gt;
	minute = 60,&lt;br /&gt;
	minutes = 60,&lt;br /&gt;
	hour = 3600,&lt;br /&gt;
	hours = 3600,&lt;br /&gt;
	day = 86400,&lt;br /&gt;
	days = 86400,&lt;br /&gt;
	month = 2629800,&lt;br /&gt;
	months = 2629800,&lt;br /&gt;
	year = 31557600,&lt;br /&gt;
	years = 31557600&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = frame:getParent().args&lt;br /&gt;
&lt;br /&gt;
	local time = tonumber(args[1])&lt;br /&gt;
&lt;br /&gt;
	if time == nil or time &amp;lt; 0 then&lt;br /&gt;
		return&lt;br /&gt;
		&amp;quot;&amp;lt;strong class=&amp;#039;error&amp;#039;&amp;gt;Human readable duration error: First argument must be a positive number ([[Template:Human readable duration|help]])&amp;lt;/strong&amp;gt;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local unit = string.lower(args[2] or &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	if scale[unit] == nil then&lt;br /&gt;
		return&lt;br /&gt;
		&amp;quot;&amp;lt;strong class=&amp;#039;error&amp;#039;&amp;gt;Human readable duration error: Second argument must be a valid time unit ([[Template:Human readable duration|help]])&amp;lt;/strong&amp;gt;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local timeseconds = time * scale[unit]&lt;br /&gt;
&lt;br /&gt;
	if timeseconds &amp;lt; 59.75 then -- rounds to 59.5 seconds or less&lt;br /&gt;
		local converted = math.floor(timeseconds * 2 + 0.5) / 2&lt;br /&gt;
		return converted .. &amp;quot; second&amp;quot; .. (converted ~= 1 and &amp;quot;s&amp;quot; or &amp;quot;&amp;quot;)&lt;br /&gt;
	elseif timeseconds &amp;lt; 3585 then -- rounds to 59.5 minutes or less&lt;br /&gt;
		local converted = math.floor(timeseconds / scale.minute * 2 + 0.5) / 2&lt;br /&gt;
		return converted .. &amp;quot; minute&amp;quot; .. (converted ~= 1 and &amp;quot;s&amp;quot; or &amp;quot;&amp;quot;)&lt;br /&gt;
	elseif timeseconds &amp;lt; 258300 and timeseconds ~= 86400 and timeseconds ~= 172800 then -- rounds to 71.5 hours or less, excluding 24 and 48 hours exactly&lt;br /&gt;
		local converted = math.floor(timeseconds / scale.hour * 2 + 0.5) / 2&lt;br /&gt;
		return converted .. &amp;quot; hour&amp;quot; .. (converted ~= 1 and &amp;quot;s&amp;quot; or &amp;quot;&amp;quot;)&lt;br /&gt;
	elseif timeseconds &amp;lt; 4341600 then -- rounds to 50 days or less&lt;br /&gt;
		local converted = math.floor(timeseconds / scale.day * 2 + 0.5) / 2&lt;br /&gt;
		return converted .. &amp;quot; day&amp;quot; .. (converted ~= 1 and &amp;quot;s&amp;quot; or &amp;quot;&amp;quot;)&lt;br /&gt;
	elseif timeseconds &amp;lt; 48651300 then -- rounds to 18 months or less (rounds to nearest integer instead of 0.5)&lt;br /&gt;
		local converted = math.floor(timeseconds / scale.month + 0.5)&lt;br /&gt;
		return converted .. &amp;quot; month&amp;quot; .. (converted ~= 1 and &amp;quot;s&amp;quot; or &amp;quot;&amp;quot;)&lt;br /&gt;
	else -- anything over 18 months rounds to nearest 0.5 years&lt;br /&gt;
		local converted = math.floor(timeseconds / scale.year * 2 + 0.5) / 2&lt;br /&gt;
		return converted .. &amp;quot; year&amp;quot; .. (converted ~= 1 and &amp;quot;s&amp;quot; or &amp;quot;&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;MusikBot II</name></author>
	</entry>
</feed>