HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/timeutil.cpython-310.pyc
o

�N�g�	�@sFdZddlZddlZddlmZmZe�e�Zd	dd�Zd
dd�Z	dS)z'
Functions various time manipulations.
�N)�datetime�	timedeltac		CsF|rQt|t�rd}|}n0|�dd�}|�dd�}z	|�d�\}}Wn
ty.d}|}Ynw|s3d}t|�t|�}}t||d�}t��}||}t�	|�
��S|r�t�d|�t|tt
f�rb|Sd}|D]'}zt�d	|�t�||�}t�	|�
��WSty�t�d
|�Yqfwdj|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�
ValueErrorrr�utcnow�time�mktime�	timetuple�log�debug�float�strptime�format�join�error)	�time_in�time_atrr	�dtZtime_nowr�fmt�msg�r!�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/timeutil.py�get_timestamp_atsN
��
�
�r#�%Y-%m-%dT%H:%M:%ScCst||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``.
    )rr)r#r�strftime�	localtime)rrZout_fmtrr!r!r"�get_time_atCsr')NN)NNr$)
�__doc__�loggingrrr�	getLogger�__name__rr#r'r!r!r!r"�<module>s

4