something like this
from datetime import datetime import pytz def lon2swe(date_time): london_datetime_tzunaware = datetime.strptime(' '.join(date_time), '%Y-%m-%d %H%M%S.%f') london_datetime = london_datetime_tzunaware.replace(tzinfo = pytz.timezone('Europe/London')) swedish_datetime = london_datetime.astimezone(pytz.timezone('Europe/Stockholm')) return swedish_datetime print(lon2swe(['2016-01-16', '17:22:10.171150']))
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs