code: def to_time(dt, tzinfo=None, format=None):
      
      d = to_datetime(dt, tzinfo, format)
      if not d:
          return d
      return time_(d.hour, d.minute, d.second, d.microsecond, tzinfo=d.tzinfo)
docs: Convert a datetime to time with tzinfo