� ��g�����dZddlZddlZddlmZmZddlZejd��Zgd�Zgd�Z d d�Z d�Z d �Z d �Z d �Zed kr,ddlZddlZejej��j��dSdS)zKfontTools.misc.timeTools.py -- tools for working with OpenType timestamps. �N)�datetime�timezone) ip�rrrrrrr)�Mon�Tue�Wed�Thu�Fri�Sat�Sun) N�Jan�Feb�Mar�Apr�May�Jun�Jul�Aug�Sep�Oct�Nov�Decc ��|�tj��}t|j�dt|j�d|jd�dtjd|����}|S)a� Convert a tuple or struct_time representing a time as returned by gmtime() or localtime() to a 24-character string of the following form: >>> asctime(time.gmtime(0)) 'Thu Jan 1 00:00:00 1970' If t is not provided, the current time as returned by localtime() is used. Locale information is not used by asctime(). This is meant to normalise the output of the built-in time.asctime() across different platforms and Python versions. In Python 3.x, the day of the month is right-justified, whereas on Windows Python 2.7 it is padded with zeros. See https://github.com/fonttools/fonttools/issues/455 N� z>2z %H:%M:%S %Y)�time� localtime�DAYNAMES�tm_wday� MONTHNAMES�tm_mon�tm_mday�strftime)�t�ss �h/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/fontTools/misc/timeTools.py�asctimer&sa��$ �y� �N� � ���������1�8���� � � � � � � �m�Q�'�'�'�  �A� �H�c �p�ttjtd|tz������S)Nr)r&r�gmtime�max� epoch_diff��values r%�timestampToStringr.;s)�� �4�;�s�1�e�j�&8�9�9�:�:� ;� ;�;r'c���|dd����\}}tj|dd�d��}|�t�|��t j���}t�|��}|� ��|ksJd|zdz���t|� ����tz S)N�z %d %H:%M:%S %Y)�month�tzinfo�"z" has inconsistent weekday) �splitr�strptime�replacer�indexr�utcr�weekday�int� timestampr+)r-�wkday�mnthr#� wkday_idxs r%�timestampFromStringr??s�������)�/�/�#�#�K�E�4���%����)�%6�7�7�A� � � � �(�(��.�.�x�|� �D�D�A����u�%�%�I� �9�9�;�;�)� #� #� #�S�5�[�3O�%O� #� #� #� �q�{�{�}�}� � � � *�*r'c���tj�d��}|�t|��tz Stt j��tz ��S)N�SOURCE_DATE_EPOCH)�os�environ�getr:r+r)�source_date_epochs r%� timestampNowrFHsJ��� ���':�;�;���$��$�%�%� �2�2� �t�y�{�{�Z�'� (� (�(r'c�0�t|tz ��S�N)r:r+r,s r%�timestampSinceEpochrIPs�� �u�z�!� "� "�"r'�__main__rH)�__doc__rBrrr�calendar�timegmr+rrr&r.r?rFrI�__name__�sys�doctest�exit�testmod�failed�r'r%�<module>rUs���� � � � � � � � �'�'�'�'�'�'�'�'������X�_�;� <� <� � <� <� <����� �" � � � �:<�<�<�+�+�+�)�)�)�#�#�#� �z����J�J�J��N�N�N� �C�H�_�W�_� � � %�&�&�&�&�&� �r'
Memory