# of Months between two dates

bartc bc at freeuk.com
Fri Apr 6 05:56:21 EDT 2018


On 06/04/2018 07:16, Steven D'Aprano wrote:

> - instead of counting days, with all the difficulty that
>    causes, we could just count how many times the month
>    changes;
> 
> - in which case, Jan 31 to Feb 1 is one month.

If you book airport parking in the UK, the charge period runs from the 
midnight before the drop-off time to the midnight following the pick-up 
time (so that the first and last days are a full 24 hours).

So parking for 24 hours from 2pm one day to 2pm the next, you are 
charged for 48 hours.

That suggests you will also be charged for two full days for the two 
minutes' parking between 23:59 and 00:01, but I haven't tried it to see 
one happens.

Agree with the messiness of dealing with months, but I think it's one of 
those quirks that make life more interesting, like imperial measure. I 
don't think we really want metric applied to time and to dates. (10-day 
weeks? I don't think so.)


-- 
bartc


More information about the Python-list mailing list