I need to convert a series of naive datetimes to their local tz. Local tz is stored separately as ISO8601 format (e.g. '-0800' for PST).
I've tried replacing the datetime with a new one, adding the offset:
>>>utc_time
datetime.datetime(2014, 1, 24, 0, 32, 30, 998654)
>>>tz_offset
u'-0800'
>>>local_time = utc_time.replace(tzinfo=tz_offset)
*** TypeError: tzinfo argument must be None or of a tzinfo subclass, not type 'unicode'
and tried using pytz to localize(), which requires calling timezone() first:
>>>timezone(tz_offset)
*** UnknownTimeZoneError: '-0800'
*doc for this step here:http://pytz.sourceforge.net/#localized-times-and-date-arithmetic
Any suggestions for making these offsets work?
*similar question here but uses a different format, I think.