Difference between revisions of "Module:Sandbox"

From blackwiki
Jump to navigation Jump to search
blackwiki>Where was I last night?
(Undid revision 773615384 by 風中的刀劍 (talk))
blackwiki>Renamed user ah38aZmN
Line 1: Line 1:
 
-- Placeholder only! Do not add code.
 
-- Placeholder only! Do not add code.
 +
local base = -1830384000000
 +
local conversionfactor = 31536000
 +
 +
function CalcYear()
 +
return math.round((os.time() - base) / conversionfactor)
 +
end

Revision as of 00:46, 9 September 2017

Scribunto Testing Area

This is not an actual Lua module. It exists to provide a convenient pseudo-namespace for code testing, hopefully preventing the main Module: namespace from becoming littered with experiments, as Lua modules cannot exist as subpages in the User: namespace.

Please name your experimental modules in the following format to help keep things tidy:

Module:Sandbox/Your User Name/Module name

You can use Special:PrefixIndex/Module:Sandbox to list modules in this area.



-- Placeholder only! Do not add code.
local base = -1830384000000
local conversionfactor = 31536000

function CalcYear()
	return math.round((os.time() - base) / conversionfactor)
end