calendar
index
/usr/lib/python2.2/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).

 
Classes
            
_localized_name
 
class _localized_name
       
   Methods defined here:
__getitem__(self, item)
__init__(self, format)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'calendar'
 
Functions
            
_center(str, width)
Center a string in a field.
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.
localtime(...)
localtime([seconds]) -> (year,month,day,hour,minute,second,weekday,dayofyear,dst)
 
Convert seconds since the Epoch to a time tuple expressing local time.
When 'seconds' is not passed in, convert the current time instead.
mktime(...)
mktime(tuple) -> floating point number
 
Convert a time tuple in local time to seconds since the Epoch.
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.
strftime(...)
strftime(format[, tuple]) -> string
 
Convert a time tuple to a string according to a format specification.
See the library reference manual for formatting codes. When the time tuple
is not present, current time as returned by localtime() is used.
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']
__file__ = '/usr/lib/python2.2/calendar.pyc'
__name__ = 'calendar'
_colwidth = 20
_firstweekday = 0
_spacing = 6
day_abbr = <calendar._localized_name instance>
day_name = <calendar._localized_name instance>
mdays = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
month_abbr = <calendar._localized_name instance>
month_name = <calendar._localized_name instance>