How to find number of whole weeks between dates?

Mark Lawrence breamoreboy at yahoo.co.uk
Wed Jun 10 15:48:19 EDT 2015


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




More information about the Python-list mailing list