Module:Test

-- Usage: where YYYY = full year, MM and DD = Nth month and day

local p = {}

function p.main(frame) local tArgs = frame:getParent if not(tArgs.args[1]) then tArgs = frame end local curyear = tonumber(os.date("%Y")) local year = tonumber(tArgs.args[1] or tArgs.args["year"]) local curmonth = tonumber(os.date("%m")) local month = tonumber(tArgs.args[2] or tArgs.args["month"] or os.date("%m")) local curday = tonumber(os.date("%d")) local day = tonumber(tArgs.args[3] or tArgs.args["day"] or os.date("%d")) local age = curyear - year if curmonth < month or (curmonth == month and curday < day) then age = age - 1 end return age end

return p