模块:ASADCalendarConvertion:修订间差异

添加146字节 、​ 2025年6月6日 (星期五)
无编辑摘要
(创建页面,内容为“local p = {} -- Julian Day Number conversion function to_jdn(year, month, day) local a = math.floor((14 - month) / 12) local y = year + 4800 - a local m = month + 12 * a - 3 return day + math.floor((153 * m + 2) / 5) + 365 * y + math.floor(y / 4) - math.floor(y / 100) + math.floor(y / 400) - 32045 end function from_jdn(jdn) local f = jdn + 1401 + math.floor(math.floor((4 * jdn + 274277) / 146097) * 3 / 4) - 38 local e = 4 * f + 3 l…”)
 
无编辑摘要
 
(未显示同一用户的1个中间版本)
第74行: 第74行:
     local month = tonumber(frame.args[2])
     local month = tonumber(frame.args[2])
     local day = tonumber(frame.args[3])
     local day = tonumber(frame.args[3])
    if not year and not month and not day then
        return ""
    end
     local y, m, d = from_tdn(to_jdn(year, month, day) - AD_st + AS_st)
     local y, m, d = from_tdn(to_jdn(year, month, day) - AD_st + AS_st)
     return format_date(y, m, d, "AS")
     return format_date(y, m, d, "AS")
第82行: 第85行:
     local month = tonumber(frame.args[2])
     local month = tonumber(frame.args[2])
     local day = tonumber(frame.args[3])
     local day = tonumber(frame.args[3])
    if not year and not month and not day then
        return ""
    end
     local y, m, d = from_jdn(to_tdn(year, month, day) - AS_st + AD_st)
     local y, m, d = from_jdn(to_tdn(year, month, day) - AS_st + AD_st)
     return format_date(y, m, d, "AD")
     return format_date(y, m, d, "AD")