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:30, 24 November 2024. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}

function p.today (frame)
	return p.fromDate(os.date("!*t"))
end

function p.date (frame)
	return p.fromDate(frame)
end

function p.fromDate (frame)
	local dat = frame.args[0]
	dat.hour = 0
	dat.min = 0
	dat.sec = 0
	
	local date0 = {year=2005,month=3,day=1}
	local sinceS = os.difftime(dat, date0) + 200
	local sinceD = Math.floor(sinceS / 86400)
	
	return sinceD
end

return p