Modul:TwitterSnowflake: Unterschied zwischen den Versionen
convert user-inputted epoch to number
Keine Bearbeitungszusammenfassung |
(convert user-inputted epoch to number) |
||
Zeile 3: | Zeile 3: | ||
p.snowflakeToDate = function (frame) | p.snowflakeToDate = function (frame) | ||
format = frame.args["format"] or "!%c" | format = frame.args["format"] or "!%c" | ||
epoch = frame.args["epoch"] or 1288834974 | epoch = tonumber(frame.args["epoch"]) or 1288834974 | ||
id_str = frame.args["id_str"] | id_str = frame.args["id_str"] | ||
if type(id_str) ~= "string" then error("bad argument #1 (expected string, got " .. type(id_str) .. ")", 2) end | if type(id_str) ~= "string" then error("bad argument #1 (expected string, got " .. type(id_str) .. ")", 2) end |