Get tz offset from string
问题 I have a date which is in local time: date: "2013-12-02 22:00:00" and another value the tz: timezone_offset: "GMT-0800" If I : dateutil.parser.parse(date).isoformat() I will get: "2013-12-02T22:00:00+0000" I want to implement the date in ISO format with the tz info and get a result of: "2013-12-02T22:00:00-0800" Something close to: parse(date,tzinfos=??).isoformat() ? How can I get the tzinfo from the string timezone_offset ? 回答1: >>> from dateutil.parser import parse >>> dt = parse("2013-12