How can I get UTC offset from time zone name in python?
For example: I have Asia/Jerusalem and I want to get +0200
Asia/Jerusalem
+0200
Have you tried using the pytz project and the utcoffset method?
e.g.
>>> import datetime >>> import pytz >>> pacific_now = datetime.datetime.now(pytz.timezone('US/Pacific')) >>> pacific_now.utcoffset().total_seconds()/60/60 -7.0