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

datetime() always setting tz to UTC even if to_timezone says otherwise #19

Closed
lbolla opened this issue Dec 19, 2016 · 3 comments
Closed

Comments

@lbolla
Copy link

lbolla commented Dec 19, 2016

I find the below confusing:

In [72]: maya.when('2016-01-01').datetime(to_timezone='US/Eastern')
Out[72]: datetime.datetime(2015, 12, 31, 19, 0, tzinfo=<UTC>)

Why, if datetime() is called using to_timezone='US/Eastern', the resulting datetime object has tz_info=UTC?
Note that the resulting time is correctly UTC New Year in US/Eastern, but the tzinfo is wrong.
It's as if the resulting timezone was "replaced" rather than converted.

@kennethreitz
Copy link
Owner

ah, this is a bug

@kennethreitz
Copy link
Owner

v0.1.3 was just released, which fixes this bug.

kennethreitz added a commit that referenced this issue Dec 20, 2016
@kennethreitz
Copy link
Owner

also added a test

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