File: //usr/lib/python3/dist-packages/mercurial/utils/__pycache__/dateutil.cpython-310.pyc
o
�]Lb6. � @ s� d dl mZmZ d dlZd dlZd dlZddlmZ ddlm Z m
Z
mZ ejr=d dl
mZmZmZmZmZmZ eeef ZdZed Zdd d
�Zddd
�Zddd�Zdd� Zddd�Zddd�Zdd� ZdS )� )�absolute_import�print_functionN� )�_)�encoding�error�pycompat)�Callable�Dict�Iterable�Optional�Tuple�Union)s %Y-%m-%dT%H:%M:%Ss %Y-%m-%dT%H:%Ms %Y-%m-%dT%H%M%Ss
%Y-%m-%dT%H%Ms %Y-%m-%d %H:%M:%S� %Y-%m-%d %H:%Ms %Y-%m-%d %H%M%Ss
%Y-%m-%d %H%Ms %Y-%m-%d %I:%M:%S%pr s %Y-%m-%d %I:%M%p� %Y-%m-%ds %m-%ds %m/%ds %m/%d/%ys %m/%d/%Ys %a %b %d %H:%M:%S %Ys %a %b %d %I:%M:%S%p %Ys %a, %d %b %Y %H:%M:%Ss %b %d %H:%M:%S %Ys %b %d %I:%M:%S%p %Ys %b %d %H:%M:%Ss %b %d %I:%M:%S%ps %b %d %H:%Ms
%b %d %I:%M%ps %b %d %Ys %b %ds %H:%M:%Ss
%I:%M:%S%ps %H:%Ms %I:%M%p)s %Ys %Y-%ms %bs %b %Yc C sf | du rt � � } | dk rtd�}tjtd�| |d��tj�| �tj�| � }|jd |j }| |fS )zmReturn a unix timestamp (or the current time) as a (unixtime,
offset) tuple based off the local timezone.Nr s check your clocks negative timestamp: %d)�hinti�Q ) �timer r �
InputError�datetime�utcfromtimestamp�
fromtimestamp�days�seconds)� timestampr �delta�tz� r �:/usr/lib/python3/dist-packages/mercurial/utils/dateutil.py�makedateL s ��
�r � %a %b %d %H:%M:%S %Y %1%2c
C s� | pt � \}}d|v sd|v sd|v r@|dkrdpd}t|�d }t|d�\}}|�dd�}|�dd ||f �}|�dd
| �}|| }|dkrKd}n|dk rQd}t�d
dd�tj|d� }t�|�t� |���} | S )a� represent a (unixtime, offset) tuple as a localized time.
unixtime is seconds since the epoch, and offset is the time zone's
number of seconds away from UTC.
>>> datestr((0, 0))
'Thu Jan 01 00:00:00 1970 +0000'
>>> datestr((42, 0))
'Thu Jan 01 00:00:42 1970 +0000'
>>> datestr((-42, 0))
'Wed Dec 31 23:59:18 1969 +0000'
>>> datestr((0x7fffffff, 0))
'Tue Jan 19 03:14:07 2038 +0000'
>>> datestr((-0x80000000, 0))
'Fri Dec 13 20:45:52 1901 +0000'
s %1s %2s %zr � -� +�<