-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Negative amounts of time result in a day
from naturaldelta
#171
Comments
a day
a day
from naturaldelta
Hmm, this is because, when we get the delta between them both here: Lines 131 to 132 in b1e5d43
It's really something like: delta=datetime.timedelta(days=-1, seconds=86399, microseconds=999999) This looks quite strange, and the docs explain:
>>> timedelta(hours=-5)
datetime.timedelta(days=-1, seconds=68400)
>>> print(_)
-1 day, 19:00:00 However, we're assuming this oddness doesn't happen and find the absolute values of some delta components: Lines 142 to 143 in b1e5d43
When we do And then Line 148 in b1e5d43
And Lines 186 to 188 in b1e5d43
Really, we should have gone into the first I think doing |
print(naturaldelta(abs(datetime.now() - datetime.now()))) That seemed to be a valid work-around for the time being. |
a day
from naturaldeltaa day
from naturaldelta
What did you do?
What did you expect to happen?
Or some reasonable representation of the tiny amount of time between two consecutive
now()
calls.What actually happened?
What versions are you using?
The text was updated successfully, but these errors were encountered: