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 1:
local p = {}
 
local MONTH = {
January = 1, February = 2, March = 3, April = 4, May = 5, June = 6,
Line 5 ⟶ 6:
}
 
local function en_timestamp(date)
if not date then
return os.time() + 21600 -- fallback to current time (UTC+6)
Line 24 ⟶ 25:
 
if not (day and month and year) then
return nil, "Invalid date format. Use DD-MM-YYYY or DD Month YYYY."
end
 
Line 38 ⟶ 39:
end
 
-- Main function p.main(frame)to get BN UNIX timestamp
function p.main(date)
local UNIX = tonumber(en_timestamp(frame.args[1]))
local BN_UNIXUNIX = UNIX - 1744610400en_timestamp(date)
return BN_UNIXUNIX - 1744610400
end