{"id":25947,"date":"2021-12-03T21:29:22","date_gmt":"2021-12-03T15:59:22","guid":{"rendered":"https:\/\/python-programs.com\/?p=25947"},"modified":"2021-12-03T21:38:30","modified_gmt":"2021-12-03T16:08:30","slug":"python-program-for-calendar-itermonthdates-method-with-examples","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-for-calendar-itermonthdates-method-with-examples\/","title":{"rendered":"Python Program for calendar itermonthdates() Method with Examples"},"content":{"rendered":"

Calendar Module:<\/strong><\/p>\n

The calendar module allows you to output calendars like a program and includes extra calendar-related operations. Calendar module functions and classes make use of an idealized calendar, the current Gregorian calendar extended in both directions indefinitely.<\/p>\n

itermonthdates() Method:<\/strong><\/p>\n

Itermonthdates() returns an iterator for the specified month (1-12) of the year.
\nThis iterator will return all days (as datetime.date objects) for the month, as well as all days before or after the start or end of the month that are required to complete a week.<\/p>\n

Syntax:<\/strong><\/p>\n

itermonthdates(year, month)<\/pre>\n

Note:<\/strong><\/p>\n

datetime.date:<\/strong> A date object represents a date (year, month, and day) in an idealized calendar, which is the existing Gregorian calendar stretched in both directions indefinitely. January 1 of year 1 is referred to as day number 1, January 2 of year 1 is referred to as day number 2, and so on.<\/p>\n

Parameter Values:<\/strong><\/p>\n

year:<\/strong> This is required. It is a number. The year for which the calendar should be created.<\/p>\n

month:\u00a0<\/strong>This is required. It is a number. The month for which the calendar should be created.<\/p>\n

Return Value:<\/strong><\/p>\n

Returns an iterator for the specified month (1-12) of the year.<\/p>\n

Program for calendar itermonthdates() Method with Examples in Python<\/h2>\n