This module allows you to output calendars like the Unix cal program, and provides additional useful functions related to the calendar. By default, these calendars have Monday as the first day of the week, and Sunday as the last (the European convention). Use setfirstweekday() to set the first day of the week to Sunday (6) or to any other weekday. Parameters that specify dates are given as integers.
0
is Monday, 6
is Sunday) to start
each week. The values MONDAY, TUESDAY,
WEDNESDAY, THURSDAY, FRIDAY,
SATURDAY, and SUNDAY are provided for
convenience. For example, to set the first weekday to Sunday:
import calendar calendar.setfirstweekday(calendar.SUNDAY)
1
if year is a leap year, otherwise 0
.
0
is Monday) for year
(1970
-...), month (1
-12
), day
(1
-31
).
See Also: