local p = {} local longitude = 91.1076 local latitude = 22.9494 local timezone = 6 local date = os.date("*t")    local day, month, year = date.day, 3, date.year local c_date = os.date("%d-%m-%Y", os.time({year = year, month = month, day = day}))  local bn_module = require('মডিউল:ConvertDigit')._main local function bn(value)     return bn_module(tostring(value)) end    local function get_days_in_month(year, month)     local days_in_month = {31, (year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0)) and 29 or 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}     return days_in_month[month] end  local function to_julian_date(year, month, day, hour)     if month <= 2 then         year = year - 1         month = month + 12     end     local A = math.floor(year / 100)     local B = 2 - A + math.floor(A / 4)     local JD = math.floor(365.25 * (year + 4716)) + math.floor(30.6001 * (month + 1)) + day + B - 1524.5     return JD + (hour / 24) end  local function solar_position(JD)     local D = JD - 2451545.0     local g = math.rad((357.529 + 0.98560028 * D) % 360)     local q = (280.459 + 0.98564736 * D) % 360     local L = q + 1.915 * math.sin(g) + 0.020 * math.sin(2 * g)     local epsilon = math.rad(23.439 - 0.00000036 * D)     local delta = math.asin(math.sin(epsilon) * math.sin(math.rad(L)))     return delta end  local function equation_of_time(JD)     local D = JD - 2451545.0     local g = math.rad((357.529 + 0.98560028 * D) % 360)     local q = (280.459 + 0.98564736 * D) % 360     local L = q + 1.915 * math.sin(g) + 0.020 * math.sin(2 * g)     local e = 0.016708617     local y = math.tan(math.rad(23.44) / 2)     y = y * y     local EoT = 4 * math.deg(y * math.sin(2 * math.rad(q)) - 2 * e * math.sin(g) + 4 * e * y * math.sin(g) * math.cos(2 * math.rad(q)) - 0.5 * y * y * math.sin(4 * math.rad(q)) - 1.25 * e * e * math.sin(2 * g))     return EoT / 60 end  local function dhuhr(longitude, timezone, date) 	local JD = to_julian_date(date.year, date.month, date.day, 0)     local declination = solar_position(JD)     local eq_time = equation_of_time(JD) 	local solar_noon = (longitude / 15) - eq_time 	local dhuhr_time = solar_noon + timezone  	local dhuhr_hours = math.floor(dhuhr_time)  	local dhuhr_minutes = (dhuhr_time % 1) * 60 - 3 + 0.19 	 	if dhuhr_minutes < 0 then 	dhuhr_hours = dhuhr_hours-1 	dhuhr_minutes= 60+dhuhr_minutes 	end 	if dhuhr_hours == 0 then 	dhuhr_hours = 12 	elseif dhuhr_hours > 12 then 	dhuhr_hours = dhuhr_hours - 12 	end 	return string.format("%02d:%02d", dhuhr_hours, dhuhr_minutes)    end  local function fajr(latitude, longitude, timezone, date, twilight_angle, is_isha)     local JD = to_julian_date(date.year, date.month, date.day, 0)     local declination = solar_position(JD)     local eq_time = equation_of_time(JD)      local phi = math.rad(latitude)     local angle = math.rad(90 + twilight_angle)      local cosH = (math.cos(angle) - math.sin(phi) * math.sin(declination)) / (math.cos(phi) * math.cos(declination))     if cosH < -1 or cosH > 1 then return "সূর্য এই উচ্চতায় পৌঁছায় না" end      local H = math.deg(math.acos(cosH)) / 15     local solar_time = 12 - H - eq_time      local prayer_utc = solar_time - longitude / 15     local prayer_local = prayer_utc + timezone       local hours = math.floor(prayer_local)     local minutes = math.floor((prayer_local % 1) * 60 + 0.5)     if minutes == 60 then     	hours=hours+1     	minutes=00     end     if hours == 0 then     	hours = 12     elseif hours > 12 then     	hours = hours - 12     end     return string.format("%02d:%02d", hours, minutes) end local function asar(latitude, longitude, timezone, date, twilight_angle, is_isha)     local JD = to_julian_date(date.year, date.month, date.day, 0)     local declination = solar_position(JD)     local eq_time = equation_of_time(JD)      local phi = math.rad(latitude)       local pangle = (2+math.abs(math.tan(phi- declination)))     local q = math.atan(1/pangle)     local angle = math.rad(90+q)      local cosH = (math.cos(angle) - math.sin(phi) * math.sin(declination)) / (math.cos(phi) * math.cos(declination))     if cosH < -1 or cosH > 1 then return "সূর্য এই উচ্চতায় পৌঁছায় না" end      local H = math.deg(math.acos(cosH)) / 15     local solar_time = 12 + H - eq_time - 1.56666666666667      local prayer_utc = solar_time - longitude / 15     local prayer_local = prayer_utc + timezone       local hours = math.floor(prayer_local)     local minutes = (prayer_local % 1) * 60 -4 + 0.4     if minutes == 60 then     	hours=hours+1     	minutes=00     end     if hours == 0 then     	hours = 12     elseif hours > 12 then     	hours = hours - 12     end     return string.format("%02d:%02d", hours, minutes) end  local function magrib(latitude, longitude, timezone, date, twilight_angle)     local JD = to_julian_date(date.year, date.month, date.day, 0)     local declination = solar_position(JD)     local eq_time = equation_of_time(JD)      local phi = math.rad(latitude)     local angle = math.rad(90 + twilight_angle)      local cosH = (math.cos(angle) - math.sin(phi) * math.sin(declination)) / (math.cos(phi) * math.cos(declination))     if cosH < -1 or cosH > 1 then return "সূর্য এই উচ্চতায় পৌঁছায় না" end      local H = math.deg(math.acos(cosH)) / 15     local solar_time = 12 + H - eq_time      local prayer_utc = solar_time - longitude / 15     local prayer_local = prayer_utc + timezone       local hours = math.floor(prayer_local)     local minutes = (prayer_local % 1) * 60 + 0.8-14     if minutes == 60 then     	hours=hours+1     	minutes=00     end     if hours == 0 then     	hours = 12     elseif hours > 12 then     	hours = hours - 12     end         return string.format("%02d:%02d", hours, minutes) end  local function isha(latitude, longitude, timezone, date, twilight_angle, is_isha)     local JD = to_julian_date(date.year, date.month, date.day, 0)     local declination = solar_position(JD)     local eq_time = equation_of_time(JD)      local phi = math.rad(latitude)         local angle = math.rad(90+twilight_angle)      local cosH = (math.cos(angle) - math.sin(phi) * math.sin(declination)) / (math.cos(phi) * math.cos(declination))     if cosH < -1 or cosH > 1 then return "সূর্য এই উচ্চতায় পৌঁছায় না" end      local H = math.deg(math.acos(cosH)) / 15     local solar_time = 12 + H - eq_time      local prayer_utc = solar_time - longitude / 15     local prayer_local = prayer_utc + timezone       local hours = math.floor(prayer_local)     local minutes = (prayer_local % 1) * 60 -4 + 0.4     if minutes == 60 then     	hours=hours+1     	minutes=00     end     if hours == 0 then     	hours = 12     elseif hours > 12 then     	hours = hours - 12     end     return string.format("%02d:%02d", hours, minutes) end  function p.main()     local results = {}     local days_in_month = get_days_in_month(year, month)      table.insert(results, "{| class=\"wikitable\"\n|-\n! তারিখ !! ফজর !! যোহর !! আসর !! মাগরিব !! ইশা")      for i = 1, days_in_month do         local jd = to_julian_date(year, month, i, 0)         local equation_of_time = equation_of_time(jd)         local dhuhr = dhuhr(longitude, timezone, {year = year, month= month, day = i})           local fajr = fajr(latitude, longitude, timezone, { year = year, month = month, day = i }, 18, false)         local isha = isha(latitude, longitude, timezone, { year = year, month = month, day = i }, 18, true)         local magrib = magrib(latitude, longitude, timezone, { year = year, month = month, day = i }, 4)         local asar = asar(latitude, longitude, timezone, { year = year, month = month, day = i }, 2)                  fajr = bn(fajr)         isha = bn(isha)         magrib = bn(magrib)         asar = bn(asar)         dhuhr = bn(dhuhr)                local f_date = os.date("%d-%m-%Y", os.time({year = year, month = month, day = i}))         f_date = bn(f_date)          if f_date == bn(c_date) then             table.insert(results, string.format("|-\n|- style=\"background-color:gold;\" \n| %s || %s || %s || %s || %s || %s", f_date, fajr, dhuhr, asar, magrib, isha))                else             table.insert(results, string.format("|-\n| %s || %s || %s || %s || %s || %s", f_date, fajr, dhuhr,asar, magrib, isha))         end     end          table.insert(results, "|}")      return table.concat(results, "\n") end  return p