def format_date(str_date):
    """ Prepare string to be used by datetime.strptime using format "%Y-%m-%dT%H:%M:%S%z"
    :param str_date e.g. 2014-04-17T19:14:29+08:00:
    :return e.g. 2014-04-17T19:14:29+0800:
    """
    str_length = len(str_date)
    return str_date[:-6] + str_date[str_length-6:str_length-3] + str_date[str_length-2:]