5.8 Standard Module calendar

This module allows you to output calendars like the Unix cal(1) program.

isleap (year)
Returns 1 if year is a leap year.

leapdays (year1, year2)
Return the number of leap years in the range [year1...year2].

weekday (year, month, day)
Returns the day of the week (0 is Monday) for year (1970-...), month (1-12), day (1-31).

monthrange (year, month)
Returns weekday of first day of the month and number of days in month, for the specified year and month.

monthcalendar (year, month)
Returns a matrix representing a month's calendar. Each row represents a week; days outside of the month a represented by zeros.

prmonth (year, month[, width[, length]])
Prints a month's calendar. If width is provided, it specifies the width of the columns that the numbers are centered in. If length is given, it specifies the number of lines that each week will use.

prcal (year)
Prints the calendar for the year year.