def NumberDaysMonth(month = None, year = None):
    """Returns the number of days in the month.

    If any of the arguments is missing (month or year) the current month/year is assumed."""
    if month is None:
        m = time.localtime()[1]
    else:
        m = month

    if year is None:
        y = time.localtime()[0]
    else:
        y = year
    
    if m == 2:
        if IsLeapYear(y):
            return 29
        else:
            return 28
    elif m in (1, 3, 5, 7, 8, 10, 12):
        return 31
    else:
        return 30
Returns the number of days in the month.

    If any of the arguments is missing (month or year) the current month/year is assumed.
recipes/Python/117215_A_Date_module/recipe-117215.py