I'm trying to specify a set of timezone aware times in python, using datetime.time objects. However, this does not seem to be supported very well by the pytz library: using US/Pacific returns an odd timezone which is 53 minutes off UTC
>>> datetime.time(10, 52, tzinfo=pytz.timezone("US/Pacific"))
datetime.time(10, 52, tzinfo=<DstTzInfo 'US/Pacific' LMT-1 day, 16:07:00 STD>)
The supported way to do this, seems to be to use datetime.localize, for datetime.datetime objects, but this isn't supported for datetime.time objects
>>> pytz.timezone("US/Pacific").localize(datetime.datetime(2011, 6, 27, 2, 0, 0))
datetime.datetime(2011, 6, 27, 2, 0, tzinfo=<DstTzInfo 'US/Pacific' PDT-1 day, 17:00:00 DST>)
>>> pytz.timezone("US/Pacific").localize(datetime.time(10, 45))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/bar/.virtualenvs/foo/lib/python2.7/site-packages/pytz/tzinfo.py", line 309, in localize
loc_dt = dt + delta
TypeError: unsupported operand type(s) for +: 'datetime.time' and 'datetime.timedelta'