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

Dates are lower by 1 #29

Closed
Thordin opened this issue Mar 4, 2018 · 3 comments
Closed

Dates are lower by 1 #29

Thordin opened this issue Mar 4, 2018 · 3 comments

Comments

@Thordin
Copy link

Thordin commented Mar 4, 2018

date.fromtimestamp is supposed to take a local timestamp not a UTC one. I am in a timezone that is behind UTC, so all dates are 1 day behind.

>>> datetime.date.fromtimestamp(0)
datetime.date(1969, 12, 31)

To fix this you need to use datetime.datetime.utcfromtimestamp().date() instead.

return date.fromtimestamp(value * self.offset)

return datetime.datetime.utcfromtimestamp(value * self.offset).date()

@xzkostyan
Copy link
Member

Fixed: dcfe640.

This change will be in next release.

@Thordin
Copy link
Author

Thordin commented Mar 11, 2018

That's great, did you take a look at another fix I proposed here?

#20

@xzkostyan
Copy link
Member

Hi, @Thordin

Version 0.0.10 is released. Should we close this issue?

@Thordin Thordin closed this as completed Mar 15, 2018
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

No branches or pull requests

2 participants