Module:Bengali Unix Timestamp: Difference between revisions

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 then
day, month, month = input:match("(%d+)%-(%d+)%-(%d+)")
end
 
if date then
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
if not timestamp
then timestamp = os.time()
end
end
 
timestamp = timestamp - os.difftime(os.time(), os.time(os.date("!*t"))) + 21600
 
return timestamp
end