Content deleted Content added
No edit summary Tags: Mobile edit Mobile web edit Advanced mobile edit |
No edit summary Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
(One intermediate revision by the same user not shown) | |||
Line 6:
}
local function en_timestamp(date)
if date then
day, month, year = date:match("(%d+)%s+(%a+)%s+(%d+)")
if month then
month =
month = MONTH[month]
end
▲ end
return nil, "Invalid date format. Use DD-MM-YYYY or DD Month YYYY."
year = tonumber(year),
month = tonumber(month),
day = tonumber(day),
hour = 0
else
return os.time() + 21600 -- fallback to current time (UTC+6)
end
end
local UNIX, err = en_timestamp(date)▼
function p.main(date)▼
▲ local UNIX = en_timestamp(date)
if not UNIX then
return nil, err
else
return UNIX - 1744610400
end
end
local date = frame.args[1] or frame:getParent().args[1]
local result, err = p._main(date)
if result then
return result
else
end
end
|