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.deltadiem4(frame)
return t.parsingday(frame.args["j2"])
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="01",
fevrier="02",
mars="03",
avril="04",
mai="05",
juin="06",
juillet="07",
aout="08",
septembre="09",
octobre="10",
novembre="11",
decembre="12"}
month=MON[month]
strtemp=day..' '..month..' '..year
--return os.time({day=day,month=month,year=year})
--return os.time(os.date("%d %m %Y", strtemp))
return 10000
end
return t