Module:CalculateAge

local p = {} require('Module:StrSplit')

local input = mw.getCurrentFrame --local date = {"21.05.1999","21.05.1800"} local date = tostring(input[1])

local table = strSplit(date,",.%s-/")

function p.calculateAge reference = os.time{day=table[1], year=table[3], month=table[2]} yearsfrom = os.difftime(os.time, reference) / (356 * 24 * 60 * 60) years = math.floor(yearsfrom) mw.logObject(years) return years end return p