Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rrule return incorrect value with freq=MONTHLY #1312

Open
michaszcz opened this issue Oct 20, 2023 · 0 comments
Open

rrule return incorrect value with freq=MONTHLY #1312

michaszcz opened this issue Oct 20, 2023 · 0 comments

Comments

@michaszcz
Copy link

Code to reproduce the issue:

from dateutil.rrule import rrule, MONTHLY
import datetime

start = datetime.datetime(2023, 5, 31, 7, 5, 46, tzinfo=datetime.timezone.utc)
end = datetime.datetime(2024, 5, 31, 7, 5, 46, tzinfo=datetime.timezone.utc)  # 1 year difference
result = list(rrule(freq=MONTHLY, dtstart=start, until=end))
len(result)
result

Actual result:

>>> len(result)
8
>>> result
[datetime.datetime(2023, 5, 31, 7, 5, 46, tzinfo=datetime.timezone.utc), datetime.datetime(2023, 7, 31, 7, 5, 46, tzinfo=datetime.timezone.utc), datetime.datetime(2023, 8, 31, 7, 5, 46, tzinfo=datetime.timezone.utc), datetime.datetime(2023, 10, 31, 7, 5, 46, tzinfo=datetime.timezone.utc), datetime.datetime(2023, 12, 31, 7, 5, 46, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 1, 31, 7, 5, 46, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 3, 31, 7, 5, 46, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 5, 31, 7, 5, 46, tzinfo=datetime.timezone.utc)]

Expected result:
The length of the list should be 12, every month should be returned

Environment:
Python 3.9.8
dateutil-version = "2.8.2"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant