Handle timestamps beyond 2038

Description

Timestamps are currently converted to datetime objects using utcfromtimestamp(), which as a result of using localtime() or gmtime(), is limited to 1970 through 2038. Timestamps that fall outside this range result in a ValueError.

It looks like there are workarounds for this that should be viable (since we don't care about timezones): http://stackoverflow.com/questions/10588027/converting-timestamps-larger-than-maxint-into-datetime-objects

Environment

None

Pull Requests

None

Activity

Show:
Adam Holmberg
December 5, 2014, 6:15 PM

Note: these times are apparently handled on 64-bit platforms:

I'm assuming this issue would be to make sure 64b timestamps convert correctly on 32b platforms.

Adam Holmberg
May 11, 2015, 7:43 PM

This was addressed in the workaround first introduced for PYTHON-119.

The conversion routine is now contained in util.datetime_from_timestamp.

Existing tests around extended ranges.

I updated one deserialization test to make it work on 32-bit platforms:
https://github.com/datastax/python-driver/commit/5a235c46ffad7119e2dd6fff46861ef26d80d0f2

Michael Penick
May 15, 2015, 8:50 PM

+1 Updated test

Adam Holmberg
May 26, 2015, 2:19 PM

Assigning for review of existing tests.

Greg Bestland
May 26, 2015, 9:56 PM

I took a crack at an integration test for this, but it did improve the code coverage any greater than the unit tests, and I don't want to needless add to our integration tests runs.

This looks good thanks Adam.

Fixed

Assignee

Greg Bestland

Reporter

Tyler Hobbs

Fix versions

Labels

PM Priority

C

External issue ID

None

Doc Impact

None

Reviewer

None

Size

None

Pull Request

None

Sprint

None

Priority

Minor
Configure