def _since_epoch(cdate):
    """
    :param cdate: date format 'Wed, 06-Jun-2012 01:34:34 GMT'
    :return: UTC time
    """

    if len(cdate) < 29:  # somethings broken
        if len(cdate) < 5:
            return utc_now()

    cdate = cdate[5:] # assume short weekday, i.e. do not support obsolete RFC 1036 date format
    try:
        t = time.strptime(cdate, "%d-%b-%Y %H:%M:%S %Z")   # e.g. 18-Apr-2014 12:30:51 GMT
    except ValueError:
        try:
            t = time.strptime(cdate, "%d-%b-%y %H:%M:%S %Z")   # e.g. 18-Apr-14 12:30:51 GMT
        except ValueError:
            try:
                t = time.strptime(cdate, "%d %b %Y %H:%M:%S %Z")   # e.g. 18 Apr 2014 12:30:51 GMT
            except ValueError:
                raise Exception, 'ValueError: Date "{0}" does not match any of '.format(cdate) + \
                                 '"%d-%b-%Y %H:%M:%S %Z", ' + \
                                 '"%d-%b-%y %H:%M:%S %Z", ' + \
                                 '"%d %b %Y %H:%M:%S %Z".'
    #return int(time.mktime(t))
    return calendar.timegm(t)
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pysaml2-2.4.0/src/saml2/httpbase.py/_since_epoch/original