Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion script for seconds in given month?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
s...@pobox.com  
View profile  
 More options Apr 16 2007, 1:18 pm
Newsgroups: comp.lang.python
From: s...@pobox.com
Date: Mon, 16 Apr 2007 12:18:29 -0500
Local: Mon, Apr 16 2007 1:18 pm
Subject: Re: script for seconds in given month?

    Matt> from time import mktime
    Matt> def secondsInMonth(year, month):
    Matt>     s1 = mktime((year,month,1,0,0,0,0,0,-1))
    Matt>     s2 = mktime((year,month+1,1,0,0,0,0,0,-1))
    Matt>     return s2-s1

Probably won't work if month==12. ;-)

Skip


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.