Python Calendar Module Methods

Python Calendar Module Methods

  • A Calendar object provides several methods that can be used for preparing the calendar data for formatting. This class doesn’t do any formatting itself. This is the job of subclasses. Calendar class allows the calculations for various task based on date, month, and year. Calendar class provides the following methods:

Functions: 

1. class calendar.calendar:

  • Calendar class creates a Calendar object. A Calendar object provides several methods that can be used for preparing the calendar data for formatting. Calendar class allows the calculations for various task based on date, month, and year. Calendar class provides the following methods:
  1. iterweekdays()
  2. itermonthdates()
  3. itermonthdays()
  4. itermonthdays2()
  5. itermonthdays3()
  6. itermonthdays4()
  7. monthdatescalendar()
  8. monthday2calendar()
  9. monthdayscalendar()
  10. yeardayscalendar()
  11. yeardays2calendar()
  12. yeardayscalendar()

2. class calendar.TextCalendar

  • TextCalendar class can be used to generate plain text calendars. TextCalendar class in Python allows you to edit the calendar and use as per your requirement.
  1. formatmonth()
  2. prmonth()
  3. formatyear()
  4. pryear()

3. class calendar.HTMLCalendar:

  • HTMLCalendar class can be used to generate HTML calendars. HTMLCalendar class in Python allows you to edit the calendar and use as per your requirement.
  1. formatmonth()
  2. formatyear()
  3. formatyearpage()

4. simple TextCalendar class: 

  • simple text calendars calendar module provides the following functions :
  1. setfirstweekday()
  2. firstweekday()
  3. isleap()
  4. leapdays()
  5. weekday()
  6. weekheader()
  7. monththrange()
  8. monthcalendar()
  9. prmonth()
  10. month()
  11. prcal()
  12. calendar()

 

 

Comments