Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:number': 0.07; 'subject:How': 0.09; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'cc:addr:python-list': 0.10; 'python': 0.11; 'wed,': 0.15; 'cc:addr:lac': 0.16; 'cc:addr:openend.se': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'message-id:@fido.openend.se': 0.16; 'received:89.233': 0.16; 'received:89.233.217': 0.16; 'received:89.233.217.133': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'subject:between': 0.16; 'subject:dates': 0.16; 'subject:weeks': 0.16; 'laura': 0.18; 'cc:addr:python.org': 0.21; 'cc:2**1': 0.22; '2015': 0.23; 'module': 0.23; 'header:In-Reply-To:1': 0.24; 'data,': 0.27; '25th': 0.29; 'received:se': 0.29; 'cc:no real name:2**1': 0.29; 'url:python': 0.33; 'subject:?': 0.34; 'gives': 0.35; 'there,': 0.35; 'but': 0.36; 'url:org': 0.36; 'there': 0.36; 'url:library': 0.36; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'end': 0.39; 'url:2': 0.39; 'url:docs': 0.39; 'sure': 0.40; 'your': 0.60; 'header:Message-Id:1': 0.62; 'thursday': 0.66; 'answer.': 0.72; 'received:89': 0.80; '9th': 0.84; 'june,': 0.84; 'subject:find': 0.91 To: Marko Rauhamaa cc: python-list@python.org, lac@openend.se From: Laura Creighton Subject: Re: How to find number of whole weeks between dates? In-Reply-To: Message from Marko Rauhamaa of "Wed, 10 Jun 2015 20:38:59 +0300." <877frbwjik.fsf@elektro.pacujo.net> References: <877frbwjik.fsf@elektro.pacujo.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8694.1433958628.1@fido> Date: Wed, 10 Jun 2015 19:50:28 +0200 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [89.233.217.130]); Wed, 10 Jun 2015 19:50:30 +0200 (CEST) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433958641 news.xs4all.nl 2942 [2001:888:2000:d::a6]:57849 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92416 In a message of Wed, 10 Jun 2015 20:38:59 +0300, Marko Rauhamaa writes: >Divide the number by 7 and you have your answer. > I am not sure that is what he wants -- If he gives us a start of Tuesday the 9th of June 2015 (yesterday) and an end of Thursday the 25th of June, that's 16 days. But there is only one Monday-Friday week in there, the 14th-19th. So if the OP wants an answer of 1 for such data, he may be interested in the python calendar module https://docs.python.org/2/library/calendar.html Laura