Gregorian calendar

The Gregorian calendar was introduced by Pope Gregory XII in October 1582. It reforms the Julian calendar by adjusting leap year rules to reduce the drift versus solar year.

The Gregorian calendar, like the Julian, does not include a year 0. However, for dates before 1, this module uses the astronomical convention of including a year 0 to simplify mathematical comparisons across epochs. To present a date in the standard convention, use the gregorian.format() function.

convertdate.gregorian.format(year, month, day, format_string='%-d %B %y')
convertdate.gregorian.from_jd(jd)

Return Gregorian date in a (Y, M, D) tuple

convertdate.gregorian.legal_date(year, month, day)

Check if this is a legal date in the Gregorian calendar

convertdate.gregorian.month_length(year, month)

Calculate the length of a month in the Gregorian calendar

convertdate.gregorian.monthcalendar(year, month)

Return a list of lists that describe the calender for one month. Each inner list have 7 items, one for each weekday, starting with Sunday. These items are either None or an integer, counting from 1 to the number of days in the month. For Gregorian, this is very similiar to the built-in :meth:calendar.monthcalendar.

convertdate.gregorian.to_jd(year, month, day)

Convert gregorian date to julian day count.

convertdate.gregorian.to_jd2(year, month, day)

Gregorian to Julian Day Count for years between 1801-2099