I am testing the ability, in arrow
, to check whether a date is in a range of dates:
>>> arrow.get('06/09/2017', 'DD/MM/YYYY') in arrow.Arrow.range('day', arrow.get('06/09/2017', 'DD/MM/YYYY'), arrow.get('06/07/2018', 'DD/MM/YYYY'))
True
>>> arrow.get('06/09/2017', 'DD/MM/YYYY') in arrow.Arrow.range('day', arrow.get('07/09/2017', 'DD/MM/YYYY'), arrow.get('06/07/2018', 'DD/MM/YYYY'))
False
So far so good. I then tried to use .now()
in the same construction (today is 6 Sept 2017, the date in the tests above):
>>> arrow.now()
<Arrow [2017-09-06T21:09:02.402790+02:00]>
>>> arrow.now() in arrow.Arrow.range('day', arrow.get('06/09/2017', 'DD/MM/YYYY'), arrow.get('06/07/2018', 'DD/MM/YYYY'))
False
Why is the result False
despite .now()
being in the range?
>>> arrow.Arrow.range('day', arrow.get('06/09/2017', 'DD/MM/YYYY'), arrow.get('06/07/2018', 'DD/MM/YYYY'))
[<Arrow [2017-09-06T00:00:00+00:00]>, <Arrow [2017-09-07T00:00:00+00:00]>, ...