from dateutil import tz
import dateutil.parser


def UTC_time(ISO_datestring):
    """Converts local ISO datastring to UTC date string"""


    from_zone = tz.gettz('Pacific/Auckland')
    to_zone = tz.gettz('UTC')
    ISO_date = dateutil.parser.parse(ISO_datestring)
    UTC_date = ISO_date.astimezone(to_zone)
    UTC_date_str = UTC_date.isoformat(sep='T')
    return UTC_date_str