| Server IP : 198.38.94.13 / Your IP : 216.73.217.33 Web Server : Apache System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : revivere ( 1140) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/ |
Upload File : |
o
;j� � @ sF d Z ddlZddlZddlmZmZ e�e�Zd dd�Zd
dd�Z dS )z'
Functions various time manipulations.
� N)�datetime� timedeltac C sF | rQt | t�rd}| }n0| �dd�} | �dd�} z | �d�\}}W n
ty. d}| }Y nw |s3d}t|�t|�}}t||d�}t�� }|| }t� |�
� �S |r�t�d|� t |tt
f�rb|S d}|D ]'}zt�d |� t�||�}t� |�
� �W S ty� t�d
|� Y qfw dj|d�|�d
�}t�|� t|��dS )zm
Computes the timestamp for a future event that may occur in ``time_in`` time
or at ``time_at``.
r �h�:�m� )�hours�minuteszPredicted at specified as %s)z%H%Mz%Hh%Mz%I%pz%I:%M%pz%I:%M %pzTrying to match %sz$Did not match %s, continue searchingz8{pat} does not match any of the accepted formats: {fmts}z, )�pat�fmtsN)�
isinstance�int�replace�split�
ValueErrorr r �utcnow�time�mktime� timetuple�log�debug�float�strptime�format�join�error) �time_in�time_atr r �dtZtime_nowr �fmt�msg� r! �G/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/timeutil.py�get_timestamp_at sN
��
�
�r# �%Y-%m-%dT%H:%M:%Sc C s t | |d�}t�|t�|��S )z�
Return the time in human readable format for a future event that may occur
in ``time_in`` time, or at ``time_at``.
)r r )r# r �strftime� localtime)r r Zout_fmtr r! r! r"