Open adamkpickering opened 6 years ago
I found the source of my confusion. The seconds part of end2
in my example is about 1.1 seconds greater than the seconds part of start2
. Since (as I have discovered after reading the source a bit) intervals are tracked by seconds, and the seconds part of end2
is greater than the seconds part of start2
, we get another hour.
I can see why the code was written this way, but it seems like something that others are likely to have trouble with. Also, I can't think of a way to improve it other than documenting this. Perhaps we need a way of doing intervals by the hour/day/month etc in addition to by the second. Perhaps something using cron-like language...
Perhaps we need a way of doing intervals by the hour/day/month etc in addition to by the second.
Couldn't you just use start and end times which are precise to an hour? Without any minutes / seconds parts?
Also, I can't think of a way to improve it other than documenting this
Would you like to do that? Since you ran into it and figured it out you might be just the person for the task :)
The docs/
folder is not yet populated with content, so I think the best place for now would be the docstring of the intervals
function. What do you think?
This Issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
First of all, thanks for your work on this great library. I think I found a bug. When I run the following script:
I get the output:
As you can see the behaviour is inconsistent: the hour of
end1
is 12 and the hour of the last element oftests1
is 11 (different), whereas the hour ofend2
is 3 and the hour of the last element oftests2
is 3 (the same). I don't imagine this is how things are supposed to work - can anyone reproduce this?