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

Fix microseconds getting ignored in utils.timedelta_to_seconds #3

Merged
merged 6 commits into from Jul 25, 2017

Conversation

hyperair
Copy link
Contributor

@hyperair hyperair commented Jul 24, 2017

This fixes this bug:

In [3]: timedelta_to_seconds(datetime.timedelta(seconds=10, microseconds=1000))
Out[3]: 10

Also fixes this bug:

In [5]: time_in_seconds(datetime.datetime(1970, 1, 1))
Out[5]: -27000.0

This change is Reviewable

@coveralls
Copy link

coveralls commented Jul 24, 2017

Coverage Status

Coverage remained the same at 97.59% when pulling 0a65a74 on hyperair:fix-timedelta-to-seconds into 6b76260 on alisaifee:master.

@alisaifee
Copy link
Owner

Thanks for that - could you please add a test case that demonstrates the bug?

time.mktime assumes that the time tuple is in local time, rather than UTC. Use
calendar.timegm instead for consistency.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 97.189% when pulling 8bc4c28 on hyperair:fix-timedelta-to-seconds into 6b76260 on alisaifee:master.

3 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 97.189% when pulling 8bc4c28 on hyperair:fix-timedelta-to-seconds into 6b76260 on alisaifee:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 97.189% when pulling 8bc4c28 on hyperair:fix-timedelta-to-seconds into 6b76260 on alisaifee:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 97.189% when pulling 8bc4c28 on hyperair:fix-timedelta-to-seconds into 6b76260 on alisaifee:master.

This doesn't exist in python 2.6
@coveralls
Copy link

coveralls commented Jul 25, 2017

Coverage Status

Coverage remained the same at 97.59% when pulling 319b040 on hyperair:fix-timedelta-to-seconds into 6b76260 on alisaifee:master.

@coveralls
Copy link

coveralls commented Jul 25, 2017

Coverage Status

Coverage remained the same at 97.59% when pulling 2950705 on hyperair:fix-timedelta-to-seconds into 6b76260 on alisaifee:master.

@hyperair
Copy link
Contributor Author

hyperair commented Jul 25, 2017 via email

@alisaifee
Copy link
Owner

Looks good. Thank you.

@alisaifee alisaifee merged commit b17f13e into alisaifee:master Jul 25, 2017
@hyperair hyperair deleted the fix-timedelta-to-seconds branch July 26, 2017 08:22
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

Successfully merging this pull request may close these issues.

None yet

3 participants