The calendar Module
The calendar module supplies calendar-related functions, including functions to print a text calendar for a given month or year. By default, calendar takes Monday as the first day of the week and Sunday as the last one. To change this, call calendar.setfirstweekday. calendar handles years in module time’s range, typically 1970 to 2038. Module calendar supplies the following functions.
calendar |
Returns a multiline string with a calendar for year |
firstweekday |
Returns the current setting for the weekday that starts each week. By default, when |
isleap |
Returns |
leapdays |
Returns the total number of leap days in the years within |
month |
Returns a multiline string with a calendar for month |
monthcalendar |
Returns a list of lists of |
monthrange |
|
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access