View source for Module:Calendar
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
--[[
__ __ _ _ ____ _ _
| \/ | ___ __| |_ _| | ___ _ / ___|__ _| | ___ _ __ __| | __ _ _ __
| |\/| |/ _ \ / _` | | | | |/ _ (_) | / _` | |/ _ \ '_ \ / _` |/ _` | '__|
| | | | (_) | (_| | |_| | | __/_| |__| (_| | | __/ | | | (_| | (_| | |
|_| |_|\___/ \__,_|\__,_|_|\___(_)\____\__,_|_|\___|_| |_|\__,_|\__,_|_|
Maintainers:
* Jarekt
]]
local p = {}
-- Convert "Julian day number" (jdn) to a calendar date
-- "gregorian" is a 1 for gregorian calendar and 0 for Julian
-- based on https://en.wikipedia.org/wiki/Julian_day#Converting_Julian_or_Gregorian_calendar_date_to_Julian_day_number
function p._jdn2date(jdn, gregorian)
local f, e, g, h, year, month, day
f = jdn + 1401
if gregorian>0 then
f = f + math.floor((math.floor((4*jdn + 274277) / 146097) * 3) / 4) - 38
000
1:0
Template used on this page:
Return to Module:Calendar.