calendar
index
/usr/local/lib/python2.3/calendar.py

Calendar printing functions
 
Note when comparing these calendars to the ones printed by cal(1): 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 (0=Monday, 6=Sunday).

 
Modules
       
datetime

 
Functions
       
calendar(year, w=0, l=0, c=6)
Returns a year's calendar as a multi-line string.
firstweekday()
format3c(a, b, c, colwidth=20, spacing=6)
Prints 3-column formatting for year calendars
format3cstring(a, b, c, colwidth=20, spacing=6)
Returns a string formatted from 3 strings, centered within 3 columns.
isleap(year)
Return 1 for leap years, 0 for non-leap years.
leapdays(y1, y2)
Return number of leap years in range [y1, y2).
Assume y1 <= y2.
month(theyear, themonth, w=0, l=0)
Return a month's calendar string (multi-line).
monthcalendar(year, month)
Return a matrix representing a month's calendar.
Each row represents a week; days outside this month are zero.
monthrange(year, month)
Return weekday (0-6 ~ Mon-Sun) and number of days (28-31) for
year, month.
prcal(year, w=0, l=0, c=6)
Print a year's calendar.
prmonth(theyear, themonth, w=0, l=0)
Print a month's calendar.
prweek(theweek, width)
Print a single week (no newline).
setfirstweekday(weekday)
Set weekday (Monday=0, Sunday=6) to start each week.
timegm(tuple)
Unrelated but handy function to calculate Unix timestamp from GMT.
week(theweek, width)
Returns a single week in a string (no newline).
weekday(year, month, day)
Return weekday (0-6 ~ Mon-Sun) for year (1970-...), month (1-12),
day (1-31).
weekheader(width)
Return a header for a week.

 
Data
        EPOCH = 1970
FRIDAY = 4
February = 2
January = 1
MONDAY = 0
SATURDAY = 5
SUNDAY = 6
THURSDAY = 3
TUESDAY = 1
WEDNESDAY = 2
__all__ = ['error', 'setfirstweekday', 'firstweekday', 'isleap', 'leapdays', 'weekday', 'monthrange', 'monthcalendar', 'prmonth', 'month', 'prcal', 'calendar', 'timegm', 'month_name', 'month_abbr', 'day_name', 'day_abbr']
day_abbr = <calendar._localized_day instance>
day_name = <calendar._localized_day instance>
mdays = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
month_abbr = <calendar._localized_month instance>
month_name = <calendar._localized_month instance>