Because I need a way to convert time from CET (or CEST) to PST I want to use the pytz module. I'm a python beginner and after searching and trying a little bit with pipista and shellista I already downloaded and extracted the pytz module in pythonista.
But I'm not sure if I've done everything right.
After unzipping the pytz-2014.2.zip file I got a
pytz (folder)
pytz-egg-info (folder)
and some other files.
When I move everything in the pypi-modules folder my testscript doesn't work.
import pipista
from datetime import datetime
from pytz import timezone
fmt = "%Y-%m-%d %H:%M:%S %Z%z"
# Current time in UTC
now_utc = datetime.now(timezone('Europe/Berlin'))
print now_utc.strftime(fmt)
# Convert to US/Pacific time zone
now_pacific = now_utc.astimezone(timezone('US/Pacific'))
print now_pacific.strftime(fmt)
# Convert to Europe/Berlin time zone
now_berlin = now_pacific.astimezone(timezone('Europe/Berlin'))
print now_berlin.strftime(fmt)
When I run the script I get an UnknownTimeZoneError: 'Europe/Berlin' for line 8 (same happens if I use US/Pacific).
Do I have to do anything else to 'install' the module?
PS: I assume that it is possible to use pytz in pythonista because I found this statement.