
    Ri                        d Z ddlmZ ddlZddlmZ dZdZ e ej                         j                        Zd	dZd
dZy)zwConvert times to and from HTTP-date serialisations.

Reference: https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
    )annotationsN)parsedate_tz)MonTueWedThuFriSatSun) JanFebMarAprMayJunJulAugSepOctNovDecc                    t        j                  |       \	  }}}}}}}}}	t        |   }
t        |   }|
 d|dd| d|dd|dd|dd|ddS )z*Return HTTP-date string from epoch offset.z, 02 04: GMT)timegmtime_WEEKDAY_NAME_MONTH_NAME)epochyrmnddhhmmsswd_yd_tzweekday_namemonths               M/home/agent/.friday_env/lib/python3.12/site-packages/sphinx/util/http_date.pyepoch_to_rfc1123r0      sq    +/;;u+=(BBBBS $LOE^2bWAeWAbWAbWAbWAbWDQQ    c                   t        |       }|t        | j                  d      sd| }t        |      |d   }|dk7  rd| }t        |      t        j                  t        j
                  |dd             t        z   }|S )z*Return epoch offset from HTTP-date string.Nr   zLHTTP-date string does not meet RFC 7231 requirements (must end with 'GMT'): 	   r   zIHTTP-date string does not meet RFC 7231 requirements (must be GMT time): )r   
ValueErrorendswithr   mktimestruct_time_GMT_OFFSET)rfc1123tmsg
gmt_offset
epoch_secss        r/   rfc1123_to_epochr>      s    WAyF#&&-[2 	 o1JQ##*+/ 	 oT--ae45CJr1   )r#   floatreturnstr)r9   rA   r@   r?   )__doc__
__future__r   r   email.utilsr   r!   r"   r?   	localtime	tm_gmtoffr8   r0   r>    r1   r/   <module>rH      sG   
 #  $A9 NDNN$../Rr1   