U
    \Sh                     @   s@   d Z ddlZddlmZmZ eedddZeeddd	ZdS )
zwConvert times to and from HTTP-date serialisations.

Reference: https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
    N)
formatdate	parsedate)epochreturnc                 C   s   t | ddS )z*Return HTTP-date string from epoch offset.T)usegmt)r   )r    r   H/root/rtd-docs/venv/lib/python3.8/site-packages/sphinx/util/http_date.pyepoch_to_rfc1123
   s    r	   )rfc1123r   c                 C   s   t | }|rt|S tdS )z*Return epoch offset from HTTP-date string.N)r   timemktime
ValueError)r
   tr   r   r   rfc1123_to_epoch   s    
r   )	__doc__r   email.utilsr   r   floatstrr	   r   r   r   r   r   <module>   s   