-
Notifications
You must be signed in to change notification settings - Fork 129
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
Don't store timezone as tzinfo.tzname #36
Comments
This also happens when you create Delorean from others Delorean's datetime if timezone is different than UTC: >>> import delorean
>>> d1 = delorean.Delorean(timezone='America/Chicago')
>>> d2 = delorean.Delorean(d1.datetime)
>>> d1.next_day(1)
Delorean(datetime=2013-10-24 05:28:02.624143-05:00, timezone=America/Chicago)
>>> d2.next_day(1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/swistakm/dev/env-tebe-packets/local/lib/python2.7/site-packages/delorean/dates.py", line 311, in next_day
return Delorean(datetime=dt, timezone=self._tz)
File "/home/swistakm/dev/env-tebe-packets/local/lib/python2.7/site-packages/delorean/dates.py", line 198, in __init__
self._dt = localize(datetime, timezone)
File "/home/swistakm/dev/env-tebe-packets/local/lib/python2.7/site-packages/delorean/dates.py", line 141, in localize
tz = timezone(tz)
File "/home/swistakm/dev/env-tebe-packets/local/lib/python2.7/site-packages/pytz/__init__.py", line 180, in timezone
raise UnknownTimeZoneError(zone)
pytz.exceptions.UnknownTimeZoneError: 'CDT'
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This causes problems when using
last_*
methods off the Delorean, for example:The text was updated successfully, but these errors were encountered: