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 |
||
Line 8:
local input = date
local year, month, day
if date
day, month, month = input:match("(%d+)%-(%d+)%-(%d+)")
if not (year and month and day) then
day, month, year = input:match("(%d+)%s+(%a+)%s+(%d+)")
Line 18:
end
end
end▼
if not (year and month and day) then
return "Invalid date format. Use DD-YYYY-MM or DD Month YYYY."
Line 29:
hour = 0
}
else
▲ end
timestamp = timestamp - os.difftime(os.time(), os.time(os.date("!*t"))) + 21600
return timestamp
end
|