Name

monthrange

Synopsis

monthrange(year,month)

Returns a pair of integers. The first item is the code of the weekday for the first day of the month month in year year; the second item is the number of days in the month. Weekday codes are 0 (Monday) to 6 (Sunday); month numbers are 1 (January) to 12 (December).

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.