Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.05; 'subject:number': 0.07; 'subject:How': 0.09; 'creighton': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'wed,': 0.15; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:between': 0.16; 'subject:dates': 0.16; 'subject:weeks': 0.16; 'wrote:': 0.16; 'laura': 0.18; 'language': 0.19; 'lawrence': 0.22; '2015': 0.23; 'module': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'data,': 0.27; '25th': 0.29; 'language.': 0.32; 'url:python': 0.33; 'subject:?': 0.34; 'gives': 0.35; 'there,': 0.35; 'to:addr:python-list': 0.35; 'but': 0.36; 'url:org': 0.36; 'there': 0.36; 'url:library': 0.36; 'subject:: ': 0.37; 'received:org': 0.38; 'end': 0.39; 'url:2': 0.39; 'url:docs': 0.39; 'to:addr:python.org': 0.39; 'sure': 0.40; 'mark': 0.40; 'url:3': 0.60; 'your': 0.60; 'our': 0.64; 'charset:windows-1252': 0.65; 'thursday': 0.66; 'answer.': 0.72; 'wish': 0.72; '21st': 0.76; '9th': 0.84; 'century': 0.84; 'divide': 0.84; 'june,': 0.84; 'pythonistas,': 0.84; 'subject:find': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: How to find number of whole weeks between dates? Date: Wed, 10 Jun 2015 20:48:19 +0100 References: <877frbwjik.fsf@elektro.pacujo.net> <201506101750.t5AHoSSu008696@fido.openend.se> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-147-27-224.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <201506101750.t5AHoSSu008696@fido.openend.se> 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433965732 news.xs4all.nl 2889 [2001:888:2000:d::a6]:58887 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92422 On 10/06/2015 18:50, Laura Creighton wrote: > 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 > > For those who wish to move into the 21st century the link is https://docs.python.org/3/library/calendar.html -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence