Jump to content

Module:DafYomi

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ypn^2 (talk | contribs) at 19:18, 24 November 2024 (Created page with 'local p = {} function p.today (frame) return p.fromDate(os.time()) end function p.date (frame) return p.fromDate(os.date("*t", frame.args[1])) end function p.fromDate (frame) local dat = frame.args[0] dat.hour = 0 dat.min = 0 dat.sec = 0 local date0 = os.date("*t", "1 March 2005") local since = os.difftime(dat, date0) return since end return p'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local p = {}

function p.today (frame)
	return p.fromDate(os.time())
end

function p.date (frame)
	return p.fromDate(os.date("*t", frame.args[1]))
end

function p.fromDate (frame)
	local dat = frame.args[0]
	dat.hour = 0
	dat.min = 0
	dat.sec = 0
	
	local date0 = os.date("*t", "1 March 2005")
	local since = os.difftime(dat, date0)
	
	return since
end

return p