Module:Delta diem
Apparence
La documentation de ce module est générée par le modèle {{Documentation module}}.
Les éditeurs peuvent travailler dans le bac à sable (créer).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.
-- test Lua
-- utiliser {{#invoke:Delta diem|deltadiem}}
local t = {}
function t.deltadiem(frame)
return os.difftime (os.time{year=frame.args["année2"], month=frame.args["mois2"], day=frame.args["jour2"], hour=0}, os.time{year=frame.args["année1"], month=frame.args["mois1"], day=frame.args["jour1"], hour=0})/86400
end
function t.deltadiem2()
return os.difftime (os.time(os.date("%d %m %Y", "12 02 2013")), os.time(os.date("%d %m %Y", "30 12 2012")))/86400
end
function t.deltadiem3(frame)
return os.difftime(t.parsingday(frame.args["j2"]), t.parsingday(frame.args["j1"]))/86400
end
function t.unefonction(x)
return '[ '..x..']'
end
function t.parsingday(str)
s=str
s=s:gsub("%é", "e")
s=s:gsub("%û", "u")
p="(%d+) (%a+) (%d+)"
day,month,year=s:match(p)
MON={janvier=1,
fevrier=2,
mars=3,
avril=4,
mai=5,
juin=6,
juillet=7,
aout=8,
septembre=9,
octobre=10,
novembre=11,
decembre=12}
month=MON[month]
return os.time({day=day,month=month,year=year})
end
return t