Module:CalculateAge

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

local date = mw.getCurrentFrame --local date = "21.05.1999"

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