edfialk <[EMAIL PROTECTED]> wrote:

> Hi, does anyone happen to know of a script that would return the
> number of seconds in a month if I give it a month and a year?
> 
> My python is a little weak, but if anyone could offer some suggestions
> I think I could handle it myself, or if anyone happens to know of a
> script already written that performs this I would be extremely
> grateful.

import calendar

def seconds_in_month(month, year):
    nomatter, daysinmonth = calendar.monthrange(year, month)
    return daysinmonth * 24 * 60 * 60


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to