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

BUG: Datetimes should be converted in utc. #1635

Merged
merged 2 commits into from Jan 5, 2017
Merged

Conversation

@kglowinski
Copy link
Contributor

@kglowinski kglowinski commented Jan 5, 2017

Fixes a bug where dataframes being returned were creating US/Eastern timestamps out of the ints, potentially changing the date returned to be the date before (at 19 hours).

>>> dt = datetime.datetime(2017, 1, 4, 0, 0)
>>> today_date_epoch = int((dt.date() - datetime.date(1970,1,1)).total_seconds())
>>> today_date_epoch
1483488000
>>> datetime.datetime.fromtimestamp(today_date_epoch)
datetime.datetime(2017, 1, 3, 19, 0)

With UTC, the timestamp is now essentially being created like the following:

>>> datetime.datetime.utcfromtimestamp(today_date_epoch)
datetime.datetime(2017, 1, 4, 0, 0)
@coveralls
Copy link

@coveralls coveralls commented Jan 5, 2017

Coverage Status

Coverage remained the same at 87.216% when pulling c34e2e7 on testing-utcfromtimestamp into 5121e3f on master.

Copy link
Contributor

@yankees714 yankees714 left a comment

Makes sense to me 👍. Just noticed, should we move the comment about dates to above the kwargs block?

@kglowinski
Copy link
Contributor Author

@kglowinski kglowinski commented Jan 5, 2017

image

@coveralls
Copy link

@coveralls coveralls commented Jan 5, 2017

Coverage Status

Coverage remained the same at 87.216% when pulling ead2761 on testing-utcfromtimestamp into 5121e3f on master.

@kglowinski kglowinski merged commit f143a83 into master Jan 5, 2017
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@kglowinski kglowinski deleted the testing-utcfromtimestamp branch Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.