from dateutil import tz


def time_to_utc(in_time):
    """converts time to UTC.  if the time passed in does not have
    zone information, it is assumed to be the local timezone"""
    if in_time.tzinfo == None:
        in_time = in_time.replace(tzinfo=tz.tzlocal())
    utc_time = in_time.astimezone(tz.tzutc())
    return utc_time